I have this simple Applescript:
set theListOfValues to "apples oranges pears"
set AppleScript's text item delimiters to " "
repeat with theCurrentValue in text items of theListOfValues
if theCurrentValue is "oranges" then
log "Found it"
end if
end repeat
log "End"
set AppleScript's text item delimiters to ""I can't get the "if" test to find "oranges". It always resolves to false and so "Found it" is never logged.
What basic log am I missing here ? Why is the theCurrentValue "oranges" never equal to "oranges" ?
This is driving me barmy at present. I've scoured the Applescript language guide and Googled for hours but still can't figure out what I'm doing wrong.
Thanks.