I have several scripts that a while back just quit saving their own properties when running (they can save properties to other scripts, but their own properties are not being saved).
Since I haven’t been able to find anything on google about this, has anyone else experienced this? Besides a clean re-install of Jaguar, can anyone reccomend any steps to try. (I have fixed permissions and recently reinstalled Jaguar, but to no avail.)
Have you tried recompiling the scripts, or creating new copies by pasting the script into a new window in a script editor? I don’t know if it will help but I think I’d try it before reinstalling OS X.
Ok, that sounds familiar. I use a program named NetNewsWire and it has a script menu. When I run scripts from its menu, properties are not saved. I spoke to Brent Simmons, the developer, and he said that it was caused by the way he implemented the script menu. He further stated that it could/would be fixed. I suspect that you might be running into the same issue, although it would strike me as surprising that Apple wouldn’t do it right in iTunes. I started writing property values to a file to overcome the issue.
The main thing that bothers me about it is that it worked correctly for a very long time, and then it stopped. And I can’t remember when it stopped working or any changes I made immediately before that.
Sometime tonight in my testing I managed to make it work twice. And then I saved the file again and it stopped again.
I’m going to post a note on the apple boards too to see if that provides any help.
Maybe providing more info may help them help you. How are you saving the script? What do you mean by if I run it from the script Editor it works?? You’re saving the properties from another script or changing the properties from another script? Is the script too big to post? I probably got more Qs but watching volleyball!
I think that we should start to look in other direction for keeping our properties. In fact i’m now starting to use the ‘defaults’ command with a 'do shell script ’ of course
This looks like it would work well with strings, but more complex data structures might be a problem. It also seems as though it is solving the wrong problem.
depends on what kind of structure you are talking about. It very simple to save a list, maybe a little it harder for a record. You can store in a dictionnary ( a keyword = one value ) , an array ( a list of values), you can also stroe booleans, srings, numbers, ?
jsut try to type ‘man defaults’ in your Terminal and you’ll see.
writePropertyByName("db", 3)
readPropertyByName("db")
on readPropertyByName(thisName)
set myCommand to "defaults read com.pcs.myApp "" & thisName & """
do shell script myCommand
end readPropertyByName
on writePropertyByName(thisName, thisValue)
set myCommand to "defaults write com.pcs.myApp "" & thisName & "" " & thisValue
do shell script myCommand
end writePropertyByName
haaaa, you may be wondering about setting the type too :
type : ’ defaults help’ to get all the available formats
writePropertyByName("db", 3,"integer")
readPropertyByName("db")
on readPropertyByName(thisName)
set myCommand to "defaults read com.pcs.myApp "" & thisName & """
do shell script myCommand
end readPropertyByName
on writePropertyByName(thisName, thisValue,thisClass)
set myCommand to "defaults write com.pcs.myApp "" & thisName & "" " & "-"& thisClass &" "&thisValue
do shell script myCommand
end writePropertyByName