1

我正在尝试为消息编写 AppleScript,这样如果我收到包含 URL 的消息,该脚本会自动在我的浏览器中打开链接。

我已经能够设置一个脚本来运行,它会向我发送带有消息属性的通知,但我还不能弄清楚如何对 URL 采取行动。

这是我能够制作的:

using terms from application "Messages"
    on message received from theSender for theChat with theContents
      display notification theContents as text ¬
          with title "New Message from " & theSender
    end on message received
end using terms
4

1 回答 1

0

这是一个可能对您有所帮助的示例:

set msg to theContents as text
set AppleScript's text item delimiters to space
set msg to msg as list
repeat with x in items of msg
    if "http" is in x then
        display dialog x
    end if
end repeat
于 2013-08-30T10:53:47.740 回答