Hey guys, I was wondering if someone could point me in the right direction on getting my window to remember it’s position between launches of the application. The code I’m using to save the bounds of the window when the app quits is this at the moment:
on will quit theObject
(*Add your script here.*)
do shell script "defaults write com.tomhennigan.ituneshover bounds " & (bounds of window "mainWindow")
end will quit
Then when the app is launched I execute this:
on awake from nib theObject
(*Add your script here.*)
try
set bounds of window "mainWindow" to (do shell script "defaults read com.tomhennigan.ituneshover bounds")
on error
center window "mainWindow"
end try
show (window of theObject)
end awake from nib
Sadly this doesn’t work :(. I had a look at what the first command saved and it was:
7040102398
So I’m guessing the bounds are actually:
70 40 102 398
Any one got any ideas on how I can actually get the bounds into a list like {70,40,102,398}?
All help appreciated!