• 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
Re: Save a NSAppleScript to a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Save a NSAppleScript to a file


  • Subject: Re: Save a NSAppleScript to a file
  • From: Marcel Weiher <email@hidden>
  • Date: Mon, 24 Nov 2003 16:08:37 +0000

Any particular reason why just storing the original string an compiling "on the fly" isn't an option? That way, you have something much simpler and more accessible stored in your file.

Marcel

So I think the best is to compile the AS when the user, after he wrote the
AS text, presses the button Apply, then if there are no errors I save the
compiled script somehow, then when the user later launchs the app, my app
executes the compiled AppleScript. The problem is that I cannot save the
compiled AppleScript. I would need something like

*as = [[NSAppleScript alloc] initWithSource:asText];
ok = [*as compileAndReturnError:nil];
if(!ok) return;
NSData *asData = [NSData dataWithNSAppleScript:as];
[asData writeToFile:filePath atomically:NO];

But as you know the API dataWithNSAppleScript doesn't exist.
I think there should be a way to convert a NSAppleScript to a NSData or to a
simple pointer, but I don't know how.

--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
1d480c25f397c4786386135f8e8938e4
_______________________________________________
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.

References: 
 >Re: Save a NSAppleScript to a file (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: get icon of a running process
  • Next by Date: Re: Cocoa Building Error
  • Previous by thread: Re: Save a NSAppleScript to a file
  • Next by thread: Re: Save a NSAppleScript to a file
  • Index(es):
    • Date
    • Thread