Re: How to set color well color
Re: How to set color well color
- Subject: Re: How to set color well color
- From: Shane Stanley <email@hidden>
- Date: Tue, 13 Jul 2010 21:11:01 +1000
- Thread-topic: How to set color well color
On 13/7/10 8:25 PM, "Brian Christmas" <email@hidden> wrote:
> Can someone tell me why please?
Because you got a bum steer courtesy of a brainfart here.
You save a record as an NSDictionary, not an NSArray.
The file saving and reading methods are similar, so:
-- write to file
set myDefs to {DiskPath:tempDiskPath, DayReportDisplay:tempDayReportDisplay,
[...]}
set theDict to current application's NSDictionary's
dictionaryWithDictionary_(myDefs)
theDict's writeToFile_atomically_("/path/to/bundle/file.plist", true)
-- read from file
set theDict to current application's NSDictionary's
dictionaryWithContentsOfFile_("/path/to/bundle/file.plist")
set {DiskPath:tempDiskPath, DayReportDisplay:tempDayReportDisplay, [...]}
to theDict as record
And you can't save NSColors in a property list, just as you can't using
NSUserDefaults -- you'll need to save the lists of RGB values.
You also can't use a try like that. Instead, get the result of the
writeToFile_atomically_ -- it will be false if it failed.
--
Shane Stanley <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden