我有一个基本的AppleScript程序,基本上ping一堆服务器并获取结果,将其放入列表中,然后用户从该列表中选择。我需要查看用户的选择是否包含字符串。说“中西部”。我无法弄清楚为什么我的比较(最后几行)返回false ...这是我的脚本(对不起,它有点长)。
tell application "Viscosity" to disconnectall
delay 2
set asdf to 10
--16.33
set address to "us-midwest.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set midwest1 to pingmstime
if theIncrementValue is equal to 2 then set midwest2 to pingmstime
if theIncrementValue is equal to 3 then set midwest3 to pingmstime
if theIncrementValue is equal to 4 then set midwest4 to pingmstime
if theIncrementValue is equal to 5 then set midwest5 to pingmstime
if theIncrementValue is equal to 6 then set midwest6 to pingmstime
if theIncrementValue is equal to 7 then set midwest7 to pingmstime
if theIncrementValue is equal to 8 then set midwest8 to pingmstime
if theIncrementValue is equal to 9 then set midwest9 to pingmstime
if theIncrementValue is equal to 10 then set midwest10 to pingmstime
if theIncrementValue is equal to 10 then set midwest to ((midwest1 + midwest2 + midwest3 + midwest4 + midwest5 + midwest6 + midwest7 + midwest8 + midwest9 + midwest10) / 10)
end repeat
on getpingmstime(address)
try
set output to do shell script "ping -c 1 " & address
set outputline to (item 2 of (paragraphs of output))
set esoffset to offset of "=" in (reverse of (characters of outputline)) as text
set mstime to (characters -(esoffset - 1) through -4 of outputline) as text
return {mstime, missing value}
on error errmsg number errnum
return {false, errmsg}
end try
end getpingmstime
set address to "us-east.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set east1 to pingmstime
if theIncrementValue is equal to 2 then set east2 to pingmstime
if theIncrementValue is equal to 3 then set east3 to pingmstime
if theIncrementValue is equal to 4 then set east4 to pingmstime
if theIncrementValue is equal to 5 then set east5 to pingmstime
if theIncrementValue is equal to 6 then set east6 to pingmstime
if theIncrementValue is equal to 7 then set east7 to pingmstime
if theIncrementValue is equal to 8 then set east8 to pingmstime
if theIncrementValue is equal to 9 then set east9 to pingmstime
if theIncrementValue is equal to 10 then set east10 to pingmstime
if theIncrementValue is equal to 10 then set east to ((east1 + east2 + east3 + east4 + east5 + east6 + east7 + east8 + east9 + east10) / 10)
end repeat
set address to "us-west.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set west1 to pingmstime
if theIncrementValue is equal to 2 then set west2 to pingmstime
if theIncrementValue is equal to 3 then set west3 to pingmstime
if theIncrementValue is equal to 4 then set west4 to pingmstime
if theIncrementValue is equal to 5 then set west5 to pingmstime
if theIncrementValue is equal to 6 then set west6 to pingmstime
if theIncrementValue is equal to 7 then set west7 to pingmstime
if theIncrementValue is equal to 8 then set west8 to pingmstime
if theIncrementValue is equal to 9 then set west9 to pingmstime
if theIncrementValue is equal to 10 then set west10 to pingmstime
if theIncrementValue is equal to 10 then set west to ((west1 + west2 + west3 + west4 + west5 + west6 + west7 + west8 + west9 + west10) / 10)
end repeat
set address to "us-texas.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set texas1 to pingmstime
if theIncrementValue is equal to 2 then set texas2 to pingmstime
if theIncrementValue is equal to 3 then set texas3 to pingmstime
if theIncrementValue is equal to 4 then set texas4 to pingmstime
if theIncrementValue is equal to 5 then set texas5 to pingmstime
if theIncrementValue is equal to 6 then set texas6 to pingmstime
if theIncrementValue is equal to 7 then set texas7 to pingmstime
if theIncrementValue is equal to 8 then set texas8 to pingmstime
if theIncrementValue is equal to 9 then set texas9 to pingmstime
if theIncrementValue is equal to 10 then set texas10 to pingmstime
if theIncrementValue is equal to 10 then set texas to ((texas1 + texas2 + texas3 + texas4 + texas5 + texas6 + texas7 + texas8 + texas9 + texas10) / 10)
end repeat
set address to "us-california.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set california1 to pingmstime
if theIncrementValue is equal to 2 then set california2 to pingmstime
if theIncrementValue is equal to 3 then set california3 to pingmstime
if theIncrementValue is equal to 4 then set california4 to pingmstime
if theIncrementValue is equal to 5 then set california5 to pingmstime
if theIncrementValue is equal to 6 then set california6 to pingmstime
if theIncrementValue is equal to 7 then set california7 to pingmstime
if theIncrementValue is equal to 8 then set california8 to pingmstime
if theIncrementValue is equal to 9 then set california9 to pingmstime
if theIncrementValue is equal to 10 then set california10 to pingmstime
if theIncrementValue is equal to 10 then set california to ((california1 + california2 + california3 + california4 + california5 + california6 + california7 + california8 + california9 + california10) / 10)
end repeat
set address to "us-florida.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set florida1 to pingmstime
if theIncrementValue is equal to 2 then set florida2 to pingmstime
if theIncrementValue is equal to 3 then set florida3 to pingmstime
if theIncrementValue is equal to 4 then set florida4 to pingmstime
if theIncrementValue is equal to 5 then set florida5 to pingmstime
if theIncrementValue is equal to 6 then set florida6 to pingmstime
if theIncrementValue is equal to 7 then set florida7 to pingmstime
if theIncrementValue is equal to 8 then set florida8 to pingmstime
if theIncrementValue is equal to 9 then set florida9 to pingmstime
if theIncrementValue is equal to 10 then set florida10 to pingmstime
if theIncrementValue is equal to 10 then set florida to ((florida1 + florida2 + florida3 + florida4 + florida5 + florida6 + florida7 + florida8 + florida9 + florida10) / 10)
end repeat
set address to "ca.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set ca1 to pingmstime
if theIncrementValue is equal to 2 then set ca2 to pingmstime
if theIncrementValue is equal to 3 then set ca3 to pingmstime
if theIncrementValue is equal to 4 then set ca4 to pingmstime
if theIncrementValue is equal to 5 then set ca5 to pingmstime
if theIncrementValue is equal to 6 then set ca6 to pingmstime
if theIncrementValue is equal to 7 then set ca7 to pingmstime
if theIncrementValue is equal to 8 then set ca8 to pingmstime
if theIncrementValue is equal to 9 then set ca9 to pingmstime
if theIncrementValue is equal to 10 then set ca10 to pingmstime
if theIncrementValue is equal to 10 then set ca to ((ca1 + ca2 + ca3 + ca4 + ca5 + ca6 + ca7 + ca8 + ca9 + ca10) / 10)
end repeat
set address to "ca-toronto.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set catoronto1 to pingmstime
if theIncrementValue is equal to 2 then set catoronto2 to pingmstime
if theIncrementValue is equal to 3 then set catoronto3 to pingmstime
if theIncrementValue is equal to 4 then set catoronto4 to pingmstime
if theIncrementValue is equal to 5 then set catoronto5 to pingmstime
if theIncrementValue is equal to 6 then set catoronto6 to pingmstime
if theIncrementValue is equal to 7 then set catoronto7 to pingmstime
if theIncrementValue is equal to 8 then set catoronto8 to pingmstime
if theIncrementValue is equal to 9 then set catoronto9 to pingmstime
if theIncrementValue is equal to 10 then set catoronto10 to pingmstime
if theIncrementValue is equal to 10 then set catoronto to ((catoronto1 + catoronto2 + catoronto3 + catoronto4 + catoronto5 + catoronto6 + catoronto7 + catoronto8 + catoronto9 + catoronto10) / 10)
end repeat
set address to "uk-london.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set uklondon1 to pingmstime
if theIncrementValue is equal to 2 then set uklondon2 to pingmstime
if theIncrementValue is equal to 3 then set uklondon3 to pingmstime
if theIncrementValue is equal to 4 then set uklondon4 to pingmstime
if theIncrementValue is equal to 5 then set uklondon5 to pingmstime
if theIncrementValue is equal to 6 then set uklondon6 to pingmstime
if theIncrementValue is equal to 7 then set uklondon7 to pingmstime
if theIncrementValue is equal to 8 then set uklondon8 to pingmstime
if theIncrementValue is equal to 9 then set uklondon9 to pingmstime
if theIncrementValue is equal to 10 then set uklondon10 to pingmstime
if theIncrementValue is equal to 10 then set uklondon to ((uklondon1 + uklondon2 + uklondon3 + uklondon4 + uklondon5 + uklondon6 + uklondon7 + uklondon8 + uklondon9 + uklondon10) / 10)
end repeat
set address to "uk-southampton.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set uksouthampton1 to pingmstime
if theIncrementValue is equal to 2 then set uksouthampton2 to pingmstime
if theIncrementValue is equal to 3 then set uksouthampton3 to pingmstime
if theIncrementValue is equal to 4 then set uksouthampton4 to pingmstime
if theIncrementValue is equal to 5 then set uksouthampton5 to pingmstime
if theIncrementValue is equal to 6 then set uksouthampton6 to pingmstime
if theIncrementValue is equal to 7 then set uksouthampton7 to pingmstime
if theIncrementValue is equal to 8 then set uksouthampton8 to pingmstime
if theIncrementValue is equal to 9 then set uksouthampton9 to pingmstime
if theIncrementValue is equal to 10 then set uksouthampton10 to pingmstime
if theIncrementValue is equal to 10 then set uksouthampton to ((uksouthampton1 + uksouthampton2 + uksouthampton3 + uksouthampton4 + uksouthampton5 + uksouthampton6 + uksouthampton7 + uksouthampton8 + uksouthampton9 + uksouthampton10) / 10)
end repeat
set address to "swiss.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set swiss1 to pingmstime
if theIncrementValue is equal to 2 then set swiss2 to pingmstime
if theIncrementValue is equal to 3 then set swiss3 to pingmstime
if theIncrementValue is equal to 4 then set swiss4 to pingmstime
if theIncrementValue is equal to 5 then set swiss5 to pingmstime
if theIncrementValue is equal to 6 then set swiss6 to pingmstime
if theIncrementValue is equal to 7 then set swiss7 to pingmstime
if theIncrementValue is equal to 8 then set swiss8 to pingmstime
if theIncrementValue is equal to 9 then set swiss9 to pingmstime
if theIncrementValue is equal to 10 then set swiss10 to pingmstime
if theIncrementValue is equal to 10 then set swiss to ((swiss1 + swiss2 + swiss3 + swiss4 + swiss5 + swiss6 + swiss7 + swiss8 + swiss9 + swiss10) / 10)
end repeat
set address to "nl.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set nl1 to pingmstime
if theIncrementValue is equal to 2 then set nl2 to pingmstime
if theIncrementValue is equal to 3 then set nl3 to pingmstime
if theIncrementValue is equal to 4 then set nl4 to pingmstime
if theIncrementValue is equal to 5 then set nl5 to pingmstime
if theIncrementValue is equal to 6 then set nl6 to pingmstime
if theIncrementValue is equal to 7 then set nl7 to pingmstime
if theIncrementValue is equal to 8 then set nl8 to pingmstime
if theIncrementValue is equal to 9 then set nl9 to pingmstime
if theIncrementValue is equal to 10 then set nl10 to pingmstime
if theIncrementValue is equal to 10 then set nl to ((nl1 + nl2 + nl3 + nl4 + nl5 + nl6 + nl7 + nl8 + nl9 + nl10) / 10)
end repeat
set address to "sweden.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set sweden1 to pingmstime
if theIncrementValue is equal to 2 then set sweden2 to pingmstime
if theIncrementValue is equal to 3 then set sweden3 to pingmstime
if theIncrementValue is equal to 4 then set sweden4 to pingmstime
if theIncrementValue is equal to 5 then set sweden5 to pingmstime
if theIncrementValue is equal to 6 then set sweden6 to pingmstime
if theIncrementValue is equal to 7 then set sweden7 to pingmstime
if theIncrementValue is equal to 8 then set sweden8 to pingmstime
if theIncrementValue is equal to 9 then set sweden9 to pingmstime
if theIncrementValue is equal to 10 then set sweden10 to pingmstime
if theIncrementValue is equal to 10 then set sweden to ((sweden1 + sweden2 + sweden3 + sweden4 + sweden5 + sweden6 + sweden7 + sweden8 + sweden9 + sweden10) / 10)
end repeat
set address to "france.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set france1 to pingmstime
if theIncrementValue is equal to 2 then set france2 to pingmstime
if theIncrementValue is equal to 3 then set france3 to pingmstime
if theIncrementValue is equal to 4 then set france4 to pingmstime
if theIncrementValue is equal to 5 then set france5 to pingmstime
if theIncrementValue is equal to 6 then set france6 to pingmstime
if theIncrementValue is equal to 7 then set france7 to pingmstime
if theIncrementValue is equal to 8 then set france8 to pingmstime
if theIncrementValue is equal to 9 then set france9 to pingmstime
if theIncrementValue is equal to 10 then set france10 to pingmstime
if theIncrementValue is equal to 10 then set france to ((france1 + france2 + france3 + france4 + france5 + france6 + france7 + france8 + france9 + france10) / 10)
end repeat
set address to "germany.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set germany1 to pingmstime
if theIncrementValue is equal to 2 then set germany2 to pingmstime
if theIncrementValue is equal to 3 then set germany3 to pingmstime
if theIncrementValue is equal to 4 then set germany4 to pingmstime
if theIncrementValue is equal to 5 then set germany5 to pingmstime
if theIncrementValue is equal to 6 then set germany6 to pingmstime
if theIncrementValue is equal to 7 then set germany7 to pingmstime
if theIncrementValue is equal to 8 then set germany8 to pingmstime
if theIncrementValue is equal to 9 then set germany9 to pingmstime
if theIncrementValue is equal to 10 then set germany10 to pingmstime
if theIncrementValue is equal to 10 then set germany to ((germany1 + germany2 + germany3 + germany4 + germany5 + germany6 + germany7 + germany8 + germany9 + germany10) / 10)
end repeat
set address to "ro.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went wrong:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set ro1 to pingmstime
if theIncrementValue is equal to 2 then set ro2 to pingmstime
if theIncrementValue is equal to 3 then set ro3 to pingmstime
if theIncrementValue is equal to 4 then set ro4 to pingmstime
if theIncrementValue is equal to 5 then set ro5 to pingmstime
if theIncrementValue is equal to 6 then set ro6 to pingmstime
if theIncrementValue is equal to 7 then set ro7 to pingmstime
if theIncrementValue is equal to 8 then set ro8 to pingmstime
if theIncrementValue is equal to 9 then set ro9 to pingmstime
if theIncrementValue is equal to 10 then set ro10 to pingmstime
if theIncrementValue is equal to 10 then set ro to ((ro1 + ro2 + ro3 + ro4 + ro5 + ro6 + ro7 + ro8 + ro9 + ro10) / 10)
end repeat
set address to "hk.privateinternetaccess.com"
repeat with theIncrementValue from 1 to asdf
set {pingmstime, errmsg} to my getpingmstime(address)
if pingmstime is not false then
tell me
activate
--display dialog "Address: " & address & return & "Time: " & pingmstime
end tell
else
tell me
activate
display dialog "Something went whkng:" & return & return & errmsg
end tell
end if
if theIncrementValue is equal to 1 then set hk1 to pingmstime
if theIncrementValue is equal to 2 then set hk2 to pingmstime
if theIncrementValue is equal to 3 then set hk3 to pingmstime
if theIncrementValue is equal to 4 then set hk4 to pingmstime
if theIncrementValue is equal to 5 then set hk5 to pingmstime
if theIncrementValue is equal to 6 then set hk6 to pingmstime
if theIncrementValue is equal to 7 then set hk7 to pingmstime
if theIncrementValue is equal to 8 then set hk8 to pingmstime
if theIncrementValue is equal to 9 then set hk9 to pingmstime
if theIncrementValue is equal to 10 then set hk10 to pingmstime
if theIncrementValue is equal to 10 then set hk to ((hk1 + hk2 + hk3 + hk4 + hk5 + hk6 + hk7 + hk8 + hk9 + hk10) / 10)
end repeat
--display dialog midwest & " - Midwest"
set midwest2 to midwest & " - US, Midwest"
set east2 to east & ", US, East"
set west2 to west & " - US, West"
set texas2 to texas & " - US, Texas"
set california2 to california & " - US, California"
set ca2 to ca & " - Canada"
set catoronto2 to catoronto & " - Canada, Toronto"
set uklondon2 to uklondon & " - UK, London"
set uksouthampton2 to uksouthampton & " - UK, Southampton"
set swiss2 to swiss & " - Switzerland"
set nl2 to nl & " - Netherlands"
set sweden2 to sweden & " - Sweden"
set france2 to france & " - France"
set germany2 to germany & " - Germany"
set ro2 to ro & " - Romania"
set hk2 to hk & " - Hong Kong"
set the_list to {midwest2, east2, west2, texas2, california2, ca2, catoronto2, uklondon2, uksouthampton2, swiss2, nl2, sweden2, france2, germany2, ro2, hk2}
(*set old_delims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {ASCII character 10} -- always a linefeed
set list_string to (the_list as string)
set new_string to do shell script "echo " & quoted form of list_string & " | sort -f"
set new_list to paragraphs of (do shell script "echo " & quoted form of (the_list as string) & "| sort -d -f")
set AppleScript's text item delimiters to old_delims
--return new_list
set theResult to choose from list new_list
if theResult contains "Midwest" then
display dialog theResult
end if*)
--set the composer_list to the_list
--simple_sort(the the_list)
--on simple_sort(my_list)
set the index_list to {}
set the sorted_list to {}
repeat (the number of items in the_list) times
set the low_item to ""
repeat with i from 1 to (number of items in the_list)
if i is not in the index_list then
set this_item to item i of the_list as text
if the low_item is "" then
set the low_item to this_item
set the low_item_index to i
else if this_item comes before the low_item then
set the low_item to this_item
set the low_item_index to i
end if
end if
end repeat
set the end of sorted_list to the low_item
set the end of the index_list to the low_item_index
end repeat
set theResult to choose from list sorted_list with title "Here are the Servers in order from slowest to fastest..."
--display dialog theResult
set theResult2 to theResult
--return the sorted_list
--end simple_sort
--set theResult to choose from list sorted_list
好的,这就是表演的地方,而不是工作。尽管字符串实际上是相等的,但是比较回来时并不相等。即使我选择“中西部”,也不行。我已经在网上搜索了这个,并且无法弄清楚为什么它不会比较:
if midwest2 is equal to theResult2 then display dialog "You chose Midwest"
if not midwest2 is equal to theResult then display dialog "You didn't choose \"" & midwest2 & ". You chose \"" & theResult & "\""
if west2 is in theResult2 then display dialog "You chose West"
答案 0 :(得分:1)
从列表中选择返回列表,而不是文本。您无法将列表与文本进行比较
return {"a"} = "a"
请改为尝试:
set theResult to choose from list sorted_list with title "Here are the Servers in order from slowest to fastest..."
if theResult is false then
error number -128
else
set theResult to first item of theResult
end if