Applescript 无缘无故结束
Applescript is end telling without reason
Applescript 结果显示 "end tell"
我不知道为什么会这样,需要修复它。
当我第二次点击下一页时,"end tell"随机
这是脚本:
display dialog "What would you like to launch? choose wisely!" buttons
{"Next Page", "cancel", "Google Chrome"} default button "Next Page"
if result = {button returned:"Google Chrome"} then
tell application "Google Chrome" to activate
else if result = {button returned:"cancel"} then
else if result = {button returned:"Next Page"} then
display dialog "Page 2" buttons {"Next page", "Mari0", "Minecraft"} default button "Next page"
if result = {button returned:"Minecraft"} then
tell application "Minecraft" to activate
else if result = {button returned:"Mari0"} then
tell application "Terminal"
activate
do script with command "open /Users/_________/Desktop/Mari0.app/"
delay 1
quit
end tell
else if return = {button returned:"Next page"} then
display dialog "Page 3" buttons {"Safari", "Roblox", "Next Page"} default button "Next Page"
if result = {button returned:"Roblox"} then
tell application "Google Chrome" to open location "http://www.roblox.com/home"
else if result = {button returned:"Safari"} then
tell application "Safari" to activate
else if return = {button returned:"Next Page"} then
display dialog "Final Page" buttons {"iMessages", "Applescript Folder", "Back to Start"} default button "Back to start"
if return = {button returned:"Back to start"} then
run script (open applications)
else if return = {button returned:"iMessages"} then
tell application "Messages" to activate
else if return = {button returned:"Applescript Folder"} then
do shell script "open /Users/__________/Desktop/Applescript/"
end if
end if
end if
end if
这些是脚本的结果:
tell application "Script Editor"
display dialog "What would you like to launch? choose wisely!"
buttons {"Next Page", "cancel", "Google Chrome"} default button "Next
Page"
--> {button returned:"Next Page"}
display dialog "Page 2"
buttons {"Next page", "Mari0", "Minecraft"} default button "Next page"
--> {button returned:"Next page"}
End tell
由于您在脚本编辑器中运行进行此测试,因此您告诉 脚本编辑器运行 它。自然地,tell 块以 end tell 结束。脚本已结束,脚本编辑器已完成其工作。
Applescript 结果显示 "end tell"
我不知道为什么会这样,需要修复它。 当我第二次点击下一页时,"end tell"随机
这是脚本:
display dialog "What would you like to launch? choose wisely!" buttons
{"Next Page", "cancel", "Google Chrome"} default button "Next Page"
if result = {button returned:"Google Chrome"} then
tell application "Google Chrome" to activate
else if result = {button returned:"cancel"} then
else if result = {button returned:"Next Page"} then
display dialog "Page 2" buttons {"Next page", "Mari0", "Minecraft"} default button "Next page"
if result = {button returned:"Minecraft"} then
tell application "Minecraft" to activate
else if result = {button returned:"Mari0"} then
tell application "Terminal"
activate
do script with command "open /Users/_________/Desktop/Mari0.app/"
delay 1
quit
end tell
else if return = {button returned:"Next page"} then
display dialog "Page 3" buttons {"Safari", "Roblox", "Next Page"} default button "Next Page"
if result = {button returned:"Roblox"} then
tell application "Google Chrome" to open location "http://www.roblox.com/home"
else if result = {button returned:"Safari"} then
tell application "Safari" to activate
else if return = {button returned:"Next Page"} then
display dialog "Final Page" buttons {"iMessages", "Applescript Folder", "Back to Start"} default button "Back to start"
if return = {button returned:"Back to start"} then
run script (open applications)
else if return = {button returned:"iMessages"} then
tell application "Messages" to activate
else if return = {button returned:"Applescript Folder"} then
do shell script "open /Users/__________/Desktop/Applescript/"
end if
end if
end if
end if
这些是脚本的结果:
tell application "Script Editor"
display dialog "What would you like to launch? choose wisely!" buttons {"Next Page", "cancel", "Google Chrome"} default button "Next Page"
--> {button returned:"Next Page"}
display dialog "Page 2" buttons {"Next page", "Mari0", "Minecraft"} default button "Next page" --> {button returned:"Next page"}
End tell
由于您在脚本编辑器中运行进行此测试,因此您告诉 脚本编辑器运行 它。自然地,tell 块以 end tell 结束。脚本已结束,脚本编辑器已完成其工作。