script debugging (was Re: Barix aftermath, set unit property problem)
James Sentman
james at sentman.com
Wed Jun 10 10:56:25 EDT 2015
I was very happy with your debugging statements. Thats exactly how to do it!
There used to be a way to step through applescript code back in the classic days, and I know that other programs like script debugger have brought the same to OSX. But when I look up those API’s officially they are deprecated and only available on carbon, not cocoa. I keep wishing there was a way for me to bring better script debugging into the program and it’s on my list of stuff to look up again every few months to see if anything has changed so far though I do not see an official apple API for doing this anymore.
The latest versions of XTension are much better at logging errors in on event handlers so that you can actually tell that they happened in a handler that was caused to be run by something else, but it’s not 100%, sometimes it will just look like an error int he script that caused the handler to be run for whatever reason.
The best way to find out exactly which line in the script is causing something to fail is to just add lots of write log “1” write log “2” in between. Then you can see exactly what line is failing and then we can better figure out why.
> On Jun 10, 2015, at 8:44 AM, ard jonker <ard.jonker at xs4all.nl> wrote:
>
> I did get the problem untangled using numerous 'write log 1'...'write log 15' etc.
>
Thanks,
James
James Sentman http://sentman.com http://MacHomeAutomation.com
More information about the XTensionList
mailing list