の代わりに、ここで変数"asdf"
を使用したいと思います。input
これは簡単なように思えますが、何らかの理由で理解できません。
on run {input, parameters}
-- Type 'asdf'
delay 1.900231
set timeoutSeconds to 2.0
set uiScript to "keystroke \"asdf\""
my doWithTimeout(uiScript, timeoutSeconds)
return input
end run
on doWithTimeout(uiScript, timeoutSeconds)
set endDate to (current date) + timeoutSeconds
repeat
try
run script "tell application \"System Events\"
" & uiScript & "
end tell"
exit repeat
on error errorMessage
if ((current date) > endDate) then
error "Can not " & uiScript
end if
end try
end repeat
end doWithTimeout
たとえば、 を試してみるとset uiScript to "keystroke input"
、Automator から次のエラーが表示されます。
The action “Run AppleScript” encountered an error.
Check the actionʼs properties and try running the workflow again.