这是我拥有的applescript,它用于打开Minecraft 和自动登录。当它没有捆绑在应用程序中时它可以正常工作。然而,每当我捆绑它时,它最后都会保持打开状态,然后给我错误“[脚本]的结尾不理解脚本的结尾”。我究竟做错了什么?
if application "Minecraft" is running then
beep 1
display dialog "Error: Minecraft cannot be launched as it is already running." buttons {"Cancel"} default button 1
end if
tell application "Minecraft"
launch
activate
end tell
set timeoutSeconds to 1
set uiScript to "click Ul Element \"Login\" of window \"Minecraft Launcher\" of application process \"Minecraft\""
my doWithnmeout(uiScript, tlmeoutSeconds)
end run
on doWithnmeout(uiScript, tlmeoutSeconds)
set endDate to (current date) + timeoutSeconds
repeat
try
run script " tell application \"System Events\"
" & uiScript & "
end tell"
exit repeat
end try
end repeat
end doWithnmeout
end run
tell application "Minecraft"
activate
end tell
end run