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

Re: How do I save an array in plist?


  • Subject: Re: How do I save an array in plist?
  • From: Brian Christmas <email@hidden>
  • Date: Sun, 02 Dec 2012 20:55:57 +1100

Thanks Ron. I've given up on my thoughts of a rolling number of last printed clients being saved as a plist file, but have managed to save and retrieve them as a list file quite easily.

Now I've struck a new plist problem.  I'm trying to save the number of clients displayed and saved as a plist item, but it's (once again) not being saved when altered and quitting the app.

It's being changed by a stepper, and it's value reflected in a field, which actually works, but not saved. it's variable name is clientMax, and it's values can be from 1 to 200.

Ant thoughts on why please?

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()
        tell  defaults to registerDefaults_({saveLocalftpArchive:true,clientMaxSave:50 })
        tell defaults to set my SaveLocalftpArchiveOnServer to objectForKey_("saveLocalftpArchive")
        tell defaults to set my clientMax to objectForKey_("clientMaxSave")#is always 50, even tho a stepper can drop its value to 1
        say my clientMax as text
        set  my messagesBottomtext to "Mail Manager is Running Normally"
        set temp to my readfile1("   Client List")
        if temp = {} then
            tell SmallArrayController to addObjects_({{theGraphClient:"This is a list of the last printed Clients"}})
        else
            tell SmallArrayController to addObjects_( temp )
      end if
        tell windowMain to displayIfNeeded()
        set my buttonStandbyFlag to false
my buttonStandby's setTitle_("Standby for " & theMinutesToStop & " minutes.")
        my displayData()
tell windowMain to displayIfNeeded()
        my setftpButton()
        my runMM()
end applicationWillFinishLaunching_






On 01/12/2012, at 3:13 AM, Ronald Hofmann <email@hidden> wrote:

Hi Brian,
did you succeed?

I tried to implement your code snippet into a small Test app but this is kind of tricky and almost impossible to make without knowing exactly what´s going on.
I ´ll take a look at it if you transfer the code in question into a separate TestProject. 

I did similar things in Objective-C lately without hassle.

Greetings from Switzerland, Ronald Hofmann
---
 
Am 30.11.2012 um 11:58:29 schrieb Brian Christmas <email@hidden>:

 _______________________________________________
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: Re: Checking on the existence of a file
  • Next by Date: Re: How do I save an array in plist?
  • Previous by thread: Re: Checking on the existence of a file
  • Next by thread: Re: How do I save an array in plist?
  • Index(es):
    • Date
    • Thread