使用 Automator 设置咆哮通知的文本? [英] Set text of a Growl Notification using Automator?

查看:22
本文介绍了使用 Automator 设置咆哮通知的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含显示咆哮通知"操作的 Automator 应用程序,它在出现时始终为空.我已经尝试在它之前直接使用获取指定文本"和获取变量值"操作,但我尝试过的任何操作似乎都不起作用.

I have an Automator Application containing the action "Show Growl Notification", which is always empty when it appears. I've tried using the "Get Specified Text" and "Get Value Of Variable" actions directly before it, but nothing I've tried seems to work.

推荐答案

来自 gadgetmo 的代码示例几乎是正确的,但不能像 Growl 1.4 那样工作

The code sample from gadgetmo is almost correct but won't work as is with Growl 1.4

应用程序必须已注册并启用,并且必须提供它将显示的通知列表以及哪些通知已启用.

An application must be registered and enabled and must provide a list of notifications it will present and also a list of which of those notifications are enabled.

如果您只是劫持预配置的自动机设置,则可以跳过所有配置内容,如下所示.

You can skip all that config stuff if you just hijack the preconfigured automator settings as shown below.

需要注意的要点是Automator通知"作为通知的名称,Automator"作为源应用程序.

Key points to note are "Automator notification" as the name of the notification and "Automator" as the source application.

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"
        notify with name ¬
            "Automator notification" title ¬
            "Processing Files" description ¬
            input as text application name "Automator"
    end tell
end if

这篇关于使用 Automator 设置咆哮通知的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆