• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Calling Script Objects in Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Calling Script Objects in Applescript
      • From: Ken Tozier <email@hidden>
  • Prev by Date: Re: Performance problem with GC enabled
  • Next by Date: Re: kvc/kvo for arrays defeated me.
  • Previous by thread: Re: NSTask and setuid [SOLVED]
  • Next by thread: Re: Calling Script Objects in Applescript
  • Index(es):
    • Date
    • Thread