Or, how to log from an AppleScript (saved as application) and/or view the Event Log?
None of the AppleScript's log statements can be found. I have tried adding the following to the launchd plist:
<key>StandardOutPath</key>
<string>/tmp/theProgram.log</string>
<key>StandardErrorPath</key>
<string>/tmp/theProgram_error.log</string>
after which, the files were happily created, but remain empty. Nothing is in the system log for this application, which is confirmed running.
Are the event logs saved somewhere?
Is setting a launchctl log level
necessary for this?
Best Answer
To bring the contents of Mateusz's comment here in an answer. Credit to Camelot for the steps.
The AppleScript
log
statement does not write to the StandardOutPath. Writing to a log file takes 3 steps. The second step may take 2 forms depending of wether you want to save previously written data.It may help to rewrite the 1st step as 2 statements:
I am still searching for an answer regarding the
log
statements and event log. At this point, I think they go into deep space.