Как поставить уведомление о рычании с помощью applescript?

Я использую скрипт, который обновляет мою рабочую копию SVN.

Я установил Growl. Я хочу разместить уведомления Growl после того, как мой скрипт завершит обновление моей рабочей копии SVN.

Помогите, пожалуйста.


person Buyer Pro    schedule 31.10.2012    source источник


Ответы (2)


Небольшой поиск в Google и на сайте Growl мог бы решить вашу проблему.

Щелкните здесь, чтобы узнать об этом.

Или напрямую скопируйте и вставьте этот код в свой редактор сценариев Apple и посмотрите, как он работает.

tell application "System Events"
    set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
end tell

if isRunning then
    tell application id "com.Growl.GrowlHelperApp"
        -- Make a list of all the notification types 
        -- that this script will ever send:
        set the allNotificationsList to ¬
            {"Test Notification", "Another Test Notification"}

        -- Make a list of the notifications 
        -- that will be enabled by default.      
        -- Those not enabled by default can be enabled later 
        -- in the 'Applications' tab of the Growl preferences.
        set the enabledNotificationsList to ¬
            {"Test Notification"}

        -- Register our script with growl.
        -- You can optionally (as here) set a default icon 
        -- for this script's notifications.
        register as application ¬
            "Growl AppleScript Sample" all notifications allNotificationsList ¬
            default notifications enabledNotificationsList ¬
            icon of application "Script Editor"

        --       Send a Notification...
        notify with name ¬
            "Test Notification" title ¬
            "Test Notification" description ¬
            "This is a test AppleScript notification." application name "Growl AppleScript Sample"

        notify with name ¬
            "Another Test Notification" title ¬
            "Another Test Notification :) " description ¬
            "Alas — you won't see me until you enable me..." application name "Growl AppleScript Sample"

    end tell
end if

Надеюсь, это решит ваш вопрос.

person Vighnesh Pai    schedule 31.10.2012

Я действительно предпочитаю использовать GrowlNotify (http://growl.info/extras.php#growlnotify) в скриптах. Это более простой и более прямой способ Growling через AppleScript.

person Sojourner    schedule 03.11.2012
comment
Я пробовал GrowlNotify, но у меня также установлен Bark, и Growl, похоже, не отображает сообщения GrowlNotify. - person Mike Kormendy; 31.07.2013