1

我正在使用一个脚本来更新我的 SVN 工作副本。

我已经安装了咆哮。一旦我的脚本完成更新我的 SVN 工作副本,我想发出 Growl 通知。

请帮我。

4

2 回答 2

3

在 Google 和 Growl 的网站上进行一点搜索就可以解决您的问题。

点击这里了解它。

或者直接将这段代码复制粘贴到你的苹果脚本编辑器中,看看它是如何工作的。

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

我希望这能解决你的问题。

于 2012-10-31T17:53:21.533 回答
0

我真的更喜欢在脚本中使用 GrowlNotify (http://growl.info/extras.php#growlnotify)。这是通过 AppleScript 咆哮的一种更简单、更直接的方式。

于 2012-11-03T00:28:57.277 回答