Applescript是无缘无故的结束语
Applescript结果显示为“end tell” 我不知道为什么会发生这种情况,需要修复。 当我第二次点击下一页时,它是随机结束的 以下是脚本:Applescript是无缘无故的结束语,applescript,Applescript,Applescript结果显示为“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:"G
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
以下是脚本的结果:
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
告诉应用程序“脚本编辑器”
显示对话框“您想启动什么?明智地选择!”
按钮{“下一页”、“取消”、“谷歌浏览器”}默认按钮“下一页”
第页“-->{按钮返回:“下一页”}
显示对话框“第2页” 按钮{“下一页”、“Mari0”、“Minecraft”}默认按钮“下一页” -->{按钮返回:“下一页”}
结束讲述
因为您正在脚本编辑器中运行此测试,所以您告诉脚本编辑器运行它。自然,tell块以end tell结束。脚本已结束,脚本编辑器已完成其工作。我建议使用“从列表中选择”对话框,该对话框允许用户直接选择要运行的应用程序,而不是所有这些对话框。它应该更方便用户。我同意。从列表中选择更有效。那么,您是否断言“结束告诉”实际上是由脚本编辑器而不是脚本生成的?如果是这种情况,它应该与任何其他脚本相同。是的,我知道。输出的所有内容都由tell脚本编辑器开始,并以end tell结束。它是由脚本编辑器生成的,与任何其他脚本都一样。它只是显示“end tell”还是中途停止执行?这个问题不清楚。