I've copied and pasted the code from Shane's book, restarted Xcode, & re-booted, but I still can't get the code below to add to the pList file.
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_({bottomButtonChoice:3, bottomText:"Default text"})
#tell defaults to registerDefaults_({saveLocalftpArchive:true})#,messagesTop:{{theGraphClient:"Email list"}}
tell defaults to set SaveLocalftpArchiveOnServer to objectForKey_("saveLocalftpArchive")
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_
On 30/11/2012, at 1:51 PM, Shane Stanley <
email@hidden> wrote:
On 30/11/2012, at 2:03 PM, Brian Christmas <
email@hidden> wrote:
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
If you want to use an array in an AppleScript record like that, you'll need to coerce it to a list first. But in this case you might as well start with a list:
tell current application's NSUserDefaults to set defaults to standardUserDefaults()
tell defaults to registerDefaults_({SaveLocalftpArchiveOnServer:true,messagesTop:{{theGraphClient:"Email list"}}}) # this doesn't work