[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

re: [MacPerl] Execute Compiled AppleScript



pudge@pcix.com (Chris Nandor) writes:
} In doing some research, I read somewhere that you can execute a compiled
} AppleScript from MacPerl.  How do you do this and then return the results
} to MacPerl?

Get a hold of the "Applescript Language Guide", either at a bookstore or
on-line somewhere deep in Apple's site.  They have .pdf's of the entire
book somewhere.  Anyway, after you've saved your script as a compiled
script, you do something like:

set myfunc to (load script file "path:to:compiled:script")
tell myfunc
    do your stuff
end tell

The thing returned by MacPerl::DoAppleScript will be whatever would have
been in theResult in Applescript.

I've never actually done this, so I don't know if it will speed things
up for you or not.  If you don't care about the return value, it's
easier just to

tell application "Finder"
   open alias "path:to:compiled:script"
end tell

If what you want to return is complicated, you might be better off
doing this and writing to a temporary file which MacPerl can then read
rather than using load script.

} 
} Thanks,
} 
} 
} 
} #================================================================
} perl -e 'srand();if(rand>.5){$i=0;foreach(@ARGV){@$i=split(//);$z
} [$i]=0;foreach$l(@$i){$s[$i][$z[$i]]=$l;$z[$i]++;}$i++;}foreach$m
} (@s){foreach$g(@{$m}){print$g}print" ";$m++}}else{print(join(" ",
} @ARGV))}print"\n"' McClellan Clan Motto: Think On
} 
} Chris Nandor                                       pudge@pcix.com
} PGP Key 0xB76E72AD                    http://pudge.petersons.com/
} 
} 
} 
---
--------
Paul J. Schinder
NASA Goddard Space Flight Center,
Code 693, Greenbelt, MD 20771 USA
schinder@pjstoaster.pg.md.us