Re: Save a NSAppleScript to a file
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.