Hmm... the current in-app submission for AE runs via a system call that starts a Qube GUI with many of the parameters pre-populated. The return of that call is very verbose - fetching a job number out of it would be difficult.
In order to get the job id in AE, I believe you'd have to write your own submission script for AE (you can use the one that is provided by PipelineFX as a guide - it lives in AE's scripts directory). In your version, rather than calling:
/Applications/pfx/qube/qube.app/Contents/MacOS/qube --submitDict "{'prototype':'cmdrange', 'name':'AEtest Comp 1','package':{'simpleCmdType':'aftereffects (aerender)','Project_path':'/Users/briank/pfx/demos/AfterEffects_text.aep','Output_file_path':'/output/output.[#####].jpg','All_comp_names':'Comp 1','-rqindex':'1','range':'0-300',}}"
(which is what is happening now)
You'd call something like
qbsub --range 1-300 --chunk 30 --name 'AEtest Comp 1' '"/Applications/Adobe After Effects CS5/aerender" -project "/Users/briank/pfx/demos/AfterEffects_text.aep" -s QB_FRAME_START -e QB_FRAME_END -i QB_FRAME_STEP -output "/output/output.[#####].jpg" -rqindex 1'
With that, the return value of the system call is the job id. So, for example, in some AE jsx file, this would give you the qube job id in an alert box:
var cmd = "/Applications/pfx/qube/bin/qbsub --range 1-300 --chunk 30 --name \'AEtest Comp1\' \'\"/Applications/Adobe After Effects CS5/aerender\" -project \"/Users/briank/pfx/demos/AfterEffects_text.aep\" -s QB_FRAME_START -e QB_FRAME_END -i QB_FRAME_STEP -output \"/output/output.[#####].jpg\" -rqindex 1\'";
var cmdOutput = system.callSystem(cmd);
alert(cmdOutput);
The drawback, of course, is that the user can't change any options unless you first populate some sort of a javascript dialog box with qube options then pass them through this style of submission.