Well, being able to use 8 or more globals will be a boolean playground…
When I used the clipboard as storage, I was able to see the value of the variable, so I could check the “signal flow.”
How can I observe the values of the globals? As I understand it now, they are global to all applescript(s), so perhaps I can run something in “real” applescript to display them?
Thank you for the more advanced code ideas, I am learning a lot. I’m still at 10.9.5 though. 10.10 was a music software breakpoint, so I’m desperately holding on.
Well. If you’re going to fool with the record before it goes on the clipboard:
set alpha to {property1:4, property2:"oops", property3:{1, 2, 3, 4, 5}, property4:{a:"aardvark"}, property5:Tuesday, date:(current date)}
set the clipboard to {alpha}
delay 0.2
set beta to beginning of (the clipboard as list)
-- Or:
set beta to (the clipboard as list) as record
I don’t know how or what you were displaying before. There’s no obvious way to show what’s going on in real time without holding things up. You can get a script to ‘say’ the value of a variable as long as the value’s text, a number, or a boolean:
set my print depth to "aardvark"
say my print depth
Or it can say when the flow’s entered a certain block of code:
if (footswitchSignalReceived) then
say "footswitch signal"
-- Relevant handling code here.
end if
Or, as Yvan suggested, you can set the properties of a record to several variables of interest and put the record on the ciipboard. You can then read the clipboard with a script in Script Editor and see the result in the Result pane. Obviously this only shows record that’s on the clipboard when it’s read, but it may be useful. The advantage of a record over a list is that you can give the properties meaningful labels, making it easy to identify which value’s which.
If you’re really desperate and need a message-by-message breakdown of the entire performance, you can get the script(s) to write running logs to a text file or editor. But that’s potentially a hell of a lot of data — as well as a considerable amount of extra code!
One can view the contents of the clipboard either with one of several apps. or in the Finder, under Edit, View Clipboard. The Finder window is not real time though, you need to refresh the window.
Anyway, I’m sure have enough info now. Many thanks to all who commented.