Applescript:Tellステートメント内にハンドラーを呼び出します
-
29-10-2019 - |
質問
このスクリプトを実行するたびにこのエラーが発生します。システムイベントはエラーが発生しました: "test123"がNotifyメッセージを理解していません。
コード:
--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
解決
これを試して:
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 )
)、発見した曖昧な構文の問題を回避するため。
他のヒント
あなたが何をしようとしているのか正確にはわかりませんが、ここに関数を呼び出してパスパラメーターを通過する方法の例があります
tell application "System Events"
set m to "message content"
my notify(m)
end tell
--more code...
on notify(message)
display dialog (message)
end notify
所属していません StackOverflow