syntax-error - Applescript 应为“”,但发现脚本结尾
问题描述
所以,这就是我到目前为止所写的,出于隐私原因,网络链接受到审查。我制作了这个脚本,这样我就可以轻松地访问我所有的课程链接。在我告诉程序完成任务后退出后,它不会为我的生命保存。这是我的代码:
display dialog "Where would you like to go?" buttons {"Math", "English", "Other"} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is "Math" then
display dialog "Select which math you would like to access." buttons {"Math", "Science", "Quit"} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is "Math" then
display dialog "Select which math you would like to access." buttons {"Mathway", "Powerschool", "Quit"} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is "Mathway" then
tell application "Google Chrome"
activate
open location "https://www.mathway.com/Algebra"
end tell
delay 1
tell application "Google Chrome" to activate
tell application "School Shortcuts" to quit
else if the button_pressed is "Powerschool" then
tell application "Google Chrome"
activate
open location "_"
end tell
delay 1
tell application "Google Chrome" to activate
else
tell application "School Shortcuts" to quit
end if
else if the button_pressed is "English" then
display dialog "Select which math you would like to access." buttons {"Science Calculators", "Powerschool", "Quit"} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is "Science Calculators" then
tell application "Google Chrome"
activate
open location "https://www.google.com/search?q=science+calculator&oq=science+calculator&aqs=chrome..69i57j0l9.6020j0j7&sourceid=chrome&ie=UTF-8"
end tell
delay 1
tell application "Google Chrome" to activate
tell application "School Shortcuts" to quit
else if the button_pressed is "Powerschool" then
tell application "Google Chrome"
activate
open location "_"
end tell
delay 1
tell application "Google Chrome" to activate
else
tell application "School Shortcuts" to quit
end if
else
tell application "School Shortcuts" to quit
end if
else
display dialog "Select which you would like to access." buttons {"Spanish", "Comp Tech", "Quit"} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is "Spanish" then
display dialog "Spanish" buttons {"Google Classroom", "Translate", "Quit"} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is "Google Classroom" then
tell application "Google Chrome"
activate
open location "_"
end tell
delay 1
tell application "Google Chrome" to activate
else if the button_pressed is "Translate" then
tell application "Google Chrome"
activate
open location "https://www.google.com/search?q=translate&oq=translate&aqs=chrome.0.69i59j0j0i433j0j0i433j69i60l3.1944j0j7&sourceid=chrome&ie=UTF-8"
end tell
delay 1
tell application "Google Chrome" to activate
else
tell application "School Shortcuts" to quit
end if
else if the button_pressed is "Comp Tech" then
display dialog "Comp Tech" buttons {"Google Classroom", "Youtube", "Quit"} default button 3
set the button_pressed to the button returned of the result
if the button_pressed is "Google Classroom" then
tell application "Google Chrome"
activate
open location "_"
end tell
delay 1
tell application "Google Chrome" to activate
else if the button_pressed is "Youtube" then
tell application "Google Chrome"
activate
open location "youtube.com"
end tell
delay 1
tell application "Google Chrome" to activate
else
tell application "School Shortcuts" to quit" to quit
end if
else
end if
end if
end
如果您对它为什么这样做有任何想法,我将不胜感激。
解决方案
错误
预期的“” 但发现脚本结束
表示不平衡的双引号。
在脚本的末尾是
tell application "School Shortcuts" to quit" to quit
删除(最后一个)双引号和该行的其余部分
tell application "School Shortcuts" to quit
推荐阅读
- amazon-web-services - 如何使用 Terraform 的 aws_ssm_document 在目标 VM 上运行 powershell 脚本
- javascript - 我的手风琴菜单代码有问题吗?
- python - 使用用户输入关闭 StreamConn
- javascript - “在‘@zxing/browser’中找不到导出‘BrowserMultiFormatReader’
- c++ - setField 到重复组
- leaflet - 如何设置 Openstreetmap 的样式?
- python-3.x - 将代码从 FOR 循环转换为 WHILE 循环
- python - 递归返回变量值
- google-cloud-platform - Shelly 设备和安全 MQTT 连接
- laravel - 如何在 Vue 支持的 SPA 中使用 Jetstream 身份验证而不使用惯性和 laravel 路由器?