• 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: p3consulting <email@hidden>
  • Date: Sun, 23 Nov 2003 10:51:05 +0100

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.

  • Follow-Ups:
    • Re: Save a NSAppleScript to a file
      • From: Lorenzo <email@hidden>
  • Prev by Date: Re: dealloc and instance variables
  • Next by Date: Re: dealloc and instance variables
  • Previous by thread: Save a NSAppleScript to a file
  • Next by thread: Re: Save a NSAppleScript to a file
  • Index(es):
    • Date
    • Thread