我有以下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