Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance 修复applescript的脚本编辑器脚本_Performance_Optimization_Applescript_Helper - Fatal编程技术网

Performance 修复applescript的脚本编辑器脚本

Performance 修复applescript的脚本编辑器脚本,performance,optimization,applescript,helper,Performance,Optimization,Applescript,Helper,我正在创建一个小程序,其中一个功能是字典。虽然我需要一种分割主题的方法,但由于某些原因,我的代码无法工作。我不断收到错误“预期”或“其他”等,但发现此代码的“结束告诉”: 将数学列表设置为{“数学”,“数学”} 将科学列表设置为{“科学”,“科学”} 将历史列表设置为{“历史”、“历史”、“社会研究”、“社会研究”、“社会研究”} 将阅读列表设置为{“写作”、“阅读”、“语法”、“语法”、“阅读”} 将no_list设置为{“no”,“not really”,“I am ok”,“I am go

我正在创建一个小程序,其中一个功能是字典。虽然我需要一种分割主题的方法,但由于某些原因,我的代码无法工作。我不断收到错误“预期”或“其他”等,但发现此代码的“结束告诉”:

将数学列表设置为{“数学”,“数学”}
将科学列表设置为{“科学”,“科学”}
将历史列表设置为{“历史”、“历史”、“社会研究”、“社会研究”、“社会研究”}
将阅读列表设置为{“写作”、“阅读”、“语法”、“语法”、“阅读”}
将no_list设置为{“no”,“not really”,“I am ok”,“I am good”,“I am good”}
将完整列表设置为阅读列表、数学列表、科学列表、否列表和历史列表
告诉应用程序“SpeechRecognitionServer”
设置响应以收听完整的_列表,并提示“您想在数学、科学、历史或阅读科目下搜索吗?”
如果响应=“书写”,则
将答案设置为“阅读”——否则你会得到一个非常奇怪的句子
否则,如果响应=“语法”,则
将答案设置为“阅读”——否则你会得到一个非常奇怪的句子
如果(数学列表包含响应),则
说“打开谷歌浏览器”
启动应用程序“谷歌浏览器”
否则,如果(科学列表包含响应),则
说“打开谷歌浏览器”
启动应用程序“谷歌浏览器”
否则,如果(历史记录列表包含响应),则
说“打开谷歌浏览器”
启动应用程序“谷歌浏览器”
否则,如果(阅读列表包含响应),则
说“打开谷歌浏览器”
启动应用程序“谷歌浏览器”
否则,如果(没有包含响应的列表),则
说“好吧”
结束语
结束语

一个
if-else
块以
end-if
结尾。不带
end tell

一个
if else
块以
end if
结束。不使用
end-tell

时,您还将发现,在重复、tell或if部分结束时简单键入end将自动编译为所需的正确类型的end:

tell app "itunes"
repeat 5 times
if exists playlist "Purchased" then
play track 7 of playlist "Purchased"
end
end
end
随后汇编成:

tell application "iTunes"
    repeat 5 times
        if exists playlist "Purchased" then
            play track 7 of playlist "Purchased"
        end if
    end repeat
end tell
学习使用这种输入代码的方式将加快您的生产速度,并大大减少错误和问题


祝您好运,

您还将发现,在repeat、tell或if部分的结尾处键入end将自动编译为所需的正确end类型:

tell app "itunes"
repeat 5 times
if exists playlist "Purchased" then
play track 7 of playlist "Purchased"
end
end
end
随后汇编成:

tell application "iTunes"
    repeat 5 times
        if exists playlist "Purchased" then
            play track 7 of playlist "Purchased"
        end if
    end repeat
end tell
学习使用这种输入代码的方式将加快您的生产速度,并大大减少错误和问题


祝你好运,这是对我有用的答案。谢谢克雷格·史密斯:


您还将发现,在repeat、tell或if部分结束时键入end将自动编译为所需的正确end类型:

tell app "itunes"
repeat 5 times
if exists playlist "Purchased" then
play track 7 of playlist "Purchased"
end
end
end
告诉应用程序“itunes” 重复5次 如果存在“已购买”的播放列表,则 播放播放列表“已购买”的曲目7 结束 结束 结束 随后汇编成:

tell application "iTunes"
    repeat 5 times
        if exists playlist "Purchased" then
            play track 7 of playlist "Purchased"
        end if
    end repeat
end tell
告诉应用程序“iTunes” 重复5次 如果存在“已购买”的播放列表,则 播放播放列表“已购买”的曲目7 如果结束 结束重复 结束语 学习使用这种输入代码的方式将加快您的生产速度,并大大减少错误和问题


祝你好运,这是对我有用的答案。谢谢克雷格·史密斯:


您还将发现,在repeat、tell或if部分结束时键入end将自动编译为所需的正确end类型:

tell app "itunes"
repeat 5 times
if exists playlist "Purchased" then
play track 7 of playlist "Purchased"
end
end
end
告诉应用程序“itunes” 重复5次 如果存在“已购买”的播放列表,则 播放播放列表“已购买”的曲目7 结束 结束 结束 随后汇编成:

tell application "iTunes"
    repeat 5 times
        if exists playlist "Purchased" then
            play track 7 of playlist "Purchased"
        end if
    end repeat
end tell
告诉应用程序“iTunes” 重复5次 如果存在“已购买”的播放列表,则 播放播放列表“已购买”的曲目7 如果结束 结束重复 结束语 学习使用这种输入代码的方式将加快您的生产速度,并大大减少错误和问题


祝你好运,

谢谢你这帮了大忙!谢谢你,这很有帮助!谢谢你,这很有帮助!谢谢你,这很有帮助!