Hello all!  This is fun!  I have been working on the RunScript command 
for com-scripting Adobe Illustrator with pp.
Here is my take on running javascript files.  the RunScript Function 
will run the javascript and reset the focus to ILL.
In the pp beginners forum I posted a similar thread for "DoJavaScript" 
which will let you "embed" javascript in your pp script to com-script ILL.

Function varlist()
     global ILL     = "Adobe Illustrator*"
     global ILLE = "=Illustrator"
     global ILLH = win.handle(ILL)
     global ILLC = "illustrator"
     global ILLX = ?"C:\Program Files\Adobe\Adobe Illustrator 
CS3\Support Files\Contents\Windows\Illustrator.exe"
     global scriptloc = ?"C:\Program Files\PowerPro\PPAI\"    ;;whatever 
folder the javascripts for ai are located
;--------------------------------------------------
Function ComLoad() ;;MAKE SURE TO CALL ....@comunload    WHEN EXITING 
FUNCTION CALLS!
     ....@varlist()
     If(....@isrunning()==0)do
         ....@start()
         wait.for(2000,activewindow(ILL))
     Endif
     global objname="Illustrator.Application"    ;;++csver
     global com_status, com_type
     global appRef=com.create_object(objname)
Function ComUnload();;this is end the com calls and unload com
     appRef.Release
     com.unload
     quit
;--------------------------------------------------
Function RunScript(whatscript, reset)
     ....@varlist()
     ....@comload()
     appRef.DoJavaScriptFile(scriptloc ++ whatscript)
     ....@comunload()
     if (reset == 1)do
         win.setfocus(ILLH)
     endif
     quit

Reply via email to