Calling Script Objects in Applescript
Calling Script Objects in Applescript
- Subject: Calling Script Objects in Applescript
- From: Karen van Eck <email@hidden>
- Date: Fri, 13 Mar 2009 14:23:37 +0000
We have a lot of code in libraries in Applescript. Now starting to
look at using Cocoa to move forward, as we are really using
Applescript to pretty much its limit.
But it is not a short term solution to rewrite all our Applescript
libraries in Objective-C. We need to be able to use Objective-C
programs to load and execute our Applescripts.
I've managed to get a program to execute an Applescript and to execute
a handler in an Applescript.
But most of our libraries are saved as Script Objects. Please could
someone point me in the right direction for executing a subroutine
inside a script object in an Applescript.
I'm guessing I could do something like:
NSApplescript *scriptObject = [[NSAppleScript alloc] initWithSource:
@"set scriptObject to (scriptObjectName of (load script file
scriptPath))
tell scriptObject to doHandler()"];
and execute it, but that seems to be quite klunky. There must be a
neater way to do it.
Any advice, hints and links will be gratefully received.
Thank you
Karen
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden