log and display notification not working

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

log and display notification not working Thu Oct 02, 2014 6:59 pm • by dworsham
I have a rule that executes an embedded AppleScript. I'm trying to get information about what's going on during the execution of the script, so I've tried using log statements and display notification statements. Neither has any result. They work fine when I run the script in AppleScript Editor, though.

I've even stripped the script down to a single log statement or a single display notification statement. No joy.

Any thoughts?
dworsham
 
Posts: 5
Joined: Sun Jul 15, 2012 3:33 pm

Re: log and display notification not working Fri Oct 03, 2014 12:35 pm • by Mr_Noodle
Not sure which log statement you are using, but display (which brings up UI) must be done from the context of a GUI program. The easiest way to do this is to wrap it in a "tell application "System Events"...end tell" block.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: log and display notification not working Fri Oct 03, 2014 6:47 pm • by dworsham
Unfortunately, I did try that. I've tried (I also tried adding delay 1):
tell application "System Events"
display notification "test" with title "test"
end tell

and:
log ("test")
dworsham
 
Posts: 5
Joined: Sun Jul 15, 2012 3:33 pm

Re: log and display notification not working Mon Oct 06, 2014 11:03 am • by Mr_Noodle
Not familiar with those specific commands but have you tried displaying a dialog? I know I've done that specifically and it works.

According to this, log() only works in the editor: http://stackoverflow.com/questions/1365 ... pplescript

It shows some alternate ways to log.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support