Is there a way to log all event history to a file? In particular if I have a applescript exported as a application and I run the application… anyway to log the event history that I would normally see if I ran it in the Applescript editor? I would like to see all of the event history.
Thanks
Hello.
I think you could be able to see the raw events by some low level event logging tool only, and those wouldn’t be much interesting to look at really, for the sake of reproducing what events your script/applet has accomplished.
I think you would have to sprinkle your code with log statements with the result of the events, and actually insert try error blocks where you wanted to test for error conditions.
Here is a handler that sends messages to a file, given as a second parameter without any log extension.
to logit(log_string, log_file)
do shell script ¬
"echo `date '+%Y-%m-%d %T: '`\"" & log_string & ¬
"\" >> $HOME/Library/Logs/" & log_file & ".log"
end logit
You should be able to find the file under ~/usr/logs on the left hand pane of the Console window.
Thanks. I was afraid of that