I have this sample script, copied from elsewhere here in the Script Debugger 8 forum.
use AppleScript version “2.4” – Yosemite (10.10) or later
use scripting additions
property theRunCount : 0
set theRunCount to theRunCount + 1
display dialog “This script has been run " & theRunCount & " time(s).”
I created a new Script Debugger document and pasted that script in. When I click the Run button it shows “This script has been run 1 time(s).” When I click the Run button a second time I am expecting the message to say “This script has been run 2 times(s).” But it doesn’t. No matter how many times I click the Run button it always says “This script has been run 1 time(s).”
But… if I copy the contents of that Script Debugger 8 window, and paste it into a new Script Editor window, the counter does go up by 1 every time I click Run there.
Neither of these scripts have been saved. They are just new Script Debugger and Script Editor documents.
Looking around here in the forum and in the Help for Script Debugger it seems the key is a feature in Script Debugger called “Persistent Properties.” But… first of all, I can’t find that option (supposedly in the Scripts menu according to Script Debugger’s help, but not in my copy of SD 8.0.3), and second of all, the help entry in SD 8 is talking about choosing Script > Persistent Properties when saving a script, and I have not saved these scripts yet at all.
If I do save the scripts (as applications) the one saved from Script Debugger 8 always shows “This script has been run 1 time(s).” The one saved from Script Editor always shows whatever the number was when I saved it (in my case, it’s “This script has been run 3 time(s).” because I’d clicked Run a few times before saving it).
I know that I don’t know enough about Properties but I know enough to know this is not how Properties are supposed to work!
This is with macOS 13.2.1.
If I take those two scripts (saved as applications) to another Mac running 10.13.6, the message in the dialog box increases by 1 every time I double-click either app (that is, the one saved with Script Debugger 8 works, and the one saved with Script Editor works). I don’t have Script Debugger 8 installed on that Mac but I do have SD 6 (which has a Script > Persistent Properties menu item) and in SD 6 the script does increment when run from the editor.
So… I sort of think this has to do with macOS 13.2.1.
If Properties don’t work properly in macOS 13 it’s going to be a big mess for me! Hoping that there’s a way to make things work. THANK YOU…