• 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
Preferences (user defaults) in Applescript Studio
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preferences (user defaults) in Applescript Studio


  • Subject: Preferences (user defaults) in Applescript Studio
  • From: David Durkee <email@hidden>
  • Date: Thu, 09 Dec 2004 12:28:07 -0600

Is it possible in Applescript Studio to add a list of dictionaries (i.e. an array of records) under a key in user defaults? Every way I have tried has resulted in errors at runtime. I'm trying to add data that looks like this:

{
	{
		server: "Harriet",
		volume: "Bugs"
	},
	{
		server: "Calhoun",
		volume: "Development"
	}
}

Just trying to stuff that into user defaults under a single key fails. I did find that I could add the data to the plist file using PList Editor, and after I do so, I can see the data by running my application and looking in the Explorer pane of the Dictionary Window of Script Debugger. From that I was able to determine that I could read the default entry with the code:

tell app "MyApp"
set x to content of default entry "appBugSampleServerInfo" of user defaults
end tell


But I was unable to derive any way of modifying the data that worked. Even modifying x and using the inverse:

set content of default entry "appBugSampleServerInfo" of user defaults to x

failed.

Anyone know how to do this?

David

--
David Durkee
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:
This email sent to email@hidden


  • Prev by Date: Re: Subtract 1 month from date
  • Next by Date: set the clipboard not available in some apps (like Word)
  • Previous by thread: Re: delete first 3 characters in a file name
  • Next by thread: set the clipboard not available in some apps (like Word)
  • Index(es):
    • Date
    • Thread