0

I'm experimenting with AppleScript and with Python. But the big issue i'm having now is not about Python specifically. The end goal is to be able to write Python scripts that use AppleScript features. While doing this, I'm testing in AppleScript, from the command line, and in IDLE.

If I type:

osascript -e 'display notification "Lorem ipsum dolor sit amet"'

in bash in the Terminal and run it, I get a Growl notification, but when I click on it, the Applescript editor opens up. If it's open but not active, it becomes the active application. If I create the following AppleScript file:

on run display notification "This is a notice." end run

And run it with osascript from the Terminal, when I click the Growl notification, the Script Editor opens. And the same thing happens when I use osascript in Python to run the same command.

In other words, if I use AppleScript to post a Growl notification, it always opens up the AppleScript Editor.

(I've been trying a number of sample scripts online and it appears that, at some point, maybe with Mavericks, a lot of rules for Applescript and Growl changed, since many scripts, when cut and pasted and saved, will no longer work.)

(I'm on OS X 10.9.4.)

Why does the Script Editor open? And what can I do to stop this?

1

It seems you cannot stop the opening of Script Editor easily per https://discussions.apple.com/thread/6449168

So looks like you are better off with terminal-notifier which I just tested works even with mavericks beta:

ProductName:    Mac OS X
ProductVersion: 10.10
BuildVersion:   14A299l

https://github.com/alloy/terminal-notifier

The 1st method to install works, even tho 10.10 has a new version of ruby:

 sudo gem install terminal-notifier

But brew install terminal-notifier warned:

$ brew install terminal-notifier
terminal-notifier: A full installation of Xcode.app is required to compile this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.

Everything I want in brew so far required only the command-line tools, so I'll avoid the Xcode until there is something I need that I can only get with Xdode. Nothing so far ;-)

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.