AppleScript:在tell 语句内调用处理程序
每次运行此脚本时,我都会收到此错误:系统事件收到错误:“Test123”无法理解通知消息。
代码:
--more code...
tell application "System Events"
if some_system_events_property then
my notify of "Test123" thru "Test"
end if
end tell
--more code...
to notify of message thru level
display dialog message with titel level
end notify
我尝试
my notify of "Test123" thru "Test"
用以下内容替换,但没有成功:
notify of "Test123" thru "Test" of me
(notify of "Test123" thru "Test") of me
I get this error everytime i run this script: System Events got an error: "Test123" doesn’t understand the notify message.
Code:
--more code...
tell application "System Events"
if some_system_events_property then
my notify of "Test123" thru "Test"
end if
end tell
--more code...
to notify of message thru level
display dialog message with titel level
end notify
I have tried to replace
my notify of "Test123" thru "Test"
with the following, without any success:
notify of "Test123" thru "Test" of me
(notify of "Test123" thru "Test") of me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不太确定您想要做什么,但这里是如何调用函数并传递参数的示例
not exactly sure what your trying to do but here is an example of how to call a function and pass parameter
尝试一下:
虽然我也会说我从不使用 AppleScript 处理程序的直接参数语法,但更喜欢位置参数(即
notify( message, level )
),因为它避免了不明确的语法给您带来麻烦发现了。Try this:
Although I'll also say that I never use the direct parameter syntax for AppleScript handlers, preferring positional parameters (i.e.,
notify( message, level )
), as it avoids the ambiguous syntax troubles you discovered.