我有以下AppleScript至今:AppleScript中的列表值?
# List of possible options to control the development environment.
set WhatDoUWantToDoList to {"1", "2", "3", "4"}
set MySites to {"test1", "test2"}
# task selected
set selectedTask to {choose from list WhatDoUWantToDoList with prompt "Pick your task now!!!" without multiple selections allowed}
if selectedTask is equal to {"1"} then
display dialog selectedTask
else
# site selected
set selectedSite to {choose from list MySites with prompt "Pick the site your working on!!!"}
if (selectedTask is not equal to false and selectedSite is not equal to false) then
display dialog selectedTask
display dialog selectedSite
else
display dialog "you messed up!"
end if
end if
我想,如果选择1表1只显示所选择的任务被选中的说法,但是,如果其他任何选项在列表1中选择你要移动到新的代码块,并且必须在列表2中选择一个选项,如果您在清单1和列表2中取消了,那么您就搞砸了。
关于我在这里失踪的任何想法?
我仍然不能让它进入if块
如果选择1应该进入,如果块为任务和停止,当我运行它,它还是同时运行if语句的一部分 – 2009-08-31 00:39:36您正在将问题修复在错误的地方。将set selectedTask中的{}替换为{从列表中选择WhatDoUWantToDoList,并提示“现在选择你的任务!!!”没有多个选择允许}'with()。 – 2009-08-31 19:51:24