Re: Save a NSAppleScript to a file
Re: Save a NSAppleScript to a file
- Subject: Re: Save a NSAppleScript to a file
- From: Lorenzo <email@hidden>
- Date: Sun, 23 Nov 2003 16:27:38 +0100
Hi,
thank you. I have to save the AS already compiled, because...
Let's imagine the following:
Your AS source string contains
tell application "Entourake"...
instead of
tell application "Microsoft Entourage"
so at the moment my applications compile that, the user is asked to locate
the application "Entourake". The user locates the application "Microsoft
Entourage" and this information will be stored in the compiled AS.
I want to save this AS already compiled.
If I stored the AS source code string, the user would be asked to locate the
application "Microsoft Entourage" any time my application compiles and runs
the AS. And this is boring. So at least, I would like to be able to fix the
original source code string... how?
So, I am going to check
http://homepage.mac.com/nathan_day/index.html
as you suggested. Thank you.
Best Regards
--
Lorenzo
email: email@hidden
>
From: p3consulting <email@hidden>
>
Date: Sun, 23 Nov 2003 10:51:05 +0100
>
To: email@hidden
>
Cc: email@hidden
>
Subject: Re: Save a NSAppleScript to a file
>
>
> Hi list,
>
> I created and compiled a NSAppleScript from a NSString.
>
> Now I would like to save the NSAppleScript already compiled to a file
>
> or to
>
> store it within a NSMutableArray to save to a file .plist.
>
> I can store the AS to the Array but then the array won't save.
>
> Should I convert firstly the NSAppleScript to a NSData? If so, how to
>
> do?
>
>
>
>
>
>
Saving the source code of the AppleScript in the NSArray as an NSString
>
is the simplest path.
>
NSAppleScript doesn't seem to adopt the NSCoder protocol so I don't see
>
any easy way to convert
>
the compiled data into an NSData object.
>
Unless you adopt some other AppleScript Cocoa framework like
>
http://homepage.mac.com/nathan_day/index.html
>
and
>
you will probably end up saving in a NSData the content of the
>
underlying AEDesc using [NSData dataWithBytes:length]
>
>
>
>
Pascal Pochet
>
P3 Consulting
>
email@hidden
>
http://www.p3-consulting.net
_______________________________________________
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.