Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AppleScript:tell语句内部的调用处理程序_Applescript_Handler_Tell - Fatal编程技术网

AppleScript:tell语句内部的调用处理程序

AppleScript:tell语句内部的调用处理程序,applescript,handler,tell,Applescript,Handler,Tell,每次运行此脚本时都会出现此错误:System Events出现错误:“Test123”无法理解notify消息 代码: 我试着去替换 my notify of "Test123" thru "Test" 在以下情况下,没有任何成功: notify of "Test123" thru "Test" of me (notify of "Test123" thru "Test") of me 不太清楚您想做什么,但下面是一个如何调用函数和传递参数的示例 tell application "Syst

每次运行此脚本时都会出现此错误:System Events出现错误:“Test123”无法理解notify消息

代码:

我试着去替换

my notify of "Test123" thru "Test"
在以下情况下,没有任何成功:

notify of "Test123" thru "Test" of me
(notify of "Test123" thru "Test") of me

不太清楚您想做什么,但下面是一个如何调用函数和传递参数的示例

tell application "System Events"
    set m to "message content"
    my notify(m)
end tell
--more code...
on notify(message)
    display dialog (message)
end notify
试试这个:

tell application "System Events"
    if some_system_events_property then
        tell me to notify of "Test123" thru "Test"
    end if
end tell

to notify of message thru level
    display dialog message with title level
end notify
虽然我也要说,我从来没有对AppleScript处理程序使用直接参数语法,而是更喜欢位置参数(即,
notify(message,level)
),因为它避免了您发现的不明确的语法问题。

这是什么“Test123”到“Test”之间的关系??那对我来说毫无意义
tell application "System Events"
    if some_system_events_property then
        tell me to notify of "Test123" thru "Test"
    end if
end tell

to notify of message thru level
    display dialog message with title level
end notify