• 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
Preload compiled AppleScript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preload compiled AppleScript?


  • Subject: Preload compiled AppleScript?
  • From: Nate Alf <email@hidden>
  • Date: Mon, 31 Mar 2003 16:30:26 -0600

I can execute a compiled AppleScript:

NSString *kCompiledScript = [[NSBundle mainBundle] pathForResource:@"testScript" ofType:@"scpt" ];

NSMutableString *kScriptText = [[NSMutableString alloc] initWithString:@"kTest(1, \"helloWorld\") of (load script (POSIX file \""];
[kScriptText appendString: kCompiledScript];
[kScriptText appendString: @"\"))"];

NSAppleScript *kAppleScript = [[NSAppleScript alloc] initWithSource:kScriptText];
NSString *kResult=[[NSString alloc] initWithString:[[kAppleScript executeAndReturnError:nil] stringValue]];

- But I am looking for a way to preload the compiled script (not just the NSString path), and
save, rather than having to reload it each time the script is called.

Something akin to the following vanilla AppleScript:

property kScriptLibrary : {}

on run
set kScriptLibPath to "/Path/To/Compiled/Script.scpt"
set kScriptLibrary to (load script (POSIX file kScriptLibPath)) --load and store for later use

kTest(1, "helloWorld") of kScriptLibrary
end run



Has anyone here any suggestions to make this same functionality work in Obj-C, or is this just a bad idea?

Nate
_______________________________________________
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.

  • Prev by Date: Re: Find app by signature
  • Next by Date: Re: Find app by signature
  • Previous by thread: Re: Find app by signature
  • Next by thread: Re: Separators in popups
  • Index(es):
    • Date
    • Thread