Calling AppleScript from Cocoa?
Calling AppleScript from Cocoa?
- Subject: Calling AppleScript from Cocoa?
- From: Rams <email@hidden>
- Date: Tue, 21 Jan 2003 14:16:51 -0500
Ok, here's my real question,
Using an NSAppleScript object, can I call a script's subroutine using
an NSSelector in Cocoa/Java? It doesn't look like it so far... If
not, is there ANY way to call a script's subroutine through Cocoa?? I
take it there must be, given that AppleScript Studio exists...
What I've tried so far...
I built a simple script that calls a subroutine in the run handler.
The subroutine simply displays a dialog, and finishes with a beep.
Using the handlers, nothing happens, no errors returned in the
NSMutableDictionary. I would have guessed that execute() would have at
least called the run handler, but apparently it doesn't. Take all the
handlers out and only include the code to the subroutine itself in the
NSAppleScript object and it works fine. But it's extremely not useful
since everything must be hardwired; meaning I need a different
NSAppleScript for every variable I would have otherwise passed into a
subroutine. Trying to use a NSSelector to call the subroutine and pass
it a simple string variable fails miserably.
Any suggestions/pointers/advice is greatly appreciated.
--
They call this a DeMoCrAcy?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.