• 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
How do I save an array in plist?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do I save an array in plist?


  • Subject: How do I save an array in plist?
  • From: Brian Christmas <email@hidden>
  • Date: Fri, 30 Nov 2012 14:03:57 +1100

G'day scripters

I'd like to be able to save an array to my projects preference file, but can't work out how to do it.

Could someone give me an example of how to go about it, please (or point me to a chapter of Shanes book, cause i can't find it there.)

Regards

Santa

on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
tell current application's NSUserDefaults to set defaults to standardUserDefaults()
        set messagesToptext to current application's NSMutableArray's array()
        my messagesToptext's addObject_({theGraphClient:"Email list"})
        tell defaults to registerDefaults_({SaveLocalftpArchiveOnServer:true,messagesTop:messagesToptext}) # this doesn't work
        tell defaults to set SaveLocalftpArchiveOnServer to objectForKey_("SaveLocalftpArchiveOnServer")
        tell defaults to set messagesTopText to objectForKey_("messagesTop")
        set my messagesBottomtext to "Mail Manager is Running Normally"
        tell windowMain to displayIfNeeded()
        set my buttonStandbyFlag to false
my buttonStandby's setTitle_("Standby for " & theMinutesToStop & " minutes.")
        my displayData()
my setftpButton()
        my runMM()
end applicationWillFinishLaunching_

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: How do I save an array in plist?
      • From: Shane Stanley <email@hidden>
  • Prev by Date: System Events vs defaults
  • Next by Date: Need help calling a script from within a script based on text entry
  • Previous by thread: System Events vs defaults
  • Next by thread: Re: How do I save an array in plist?
  • Index(es):
    • Date
    • Thread