Somebody explain conceptually what’s going on here; what’s the difference?
set AppleScript's text item delimiters to ASCII character (0)
repeat with x in "aabbccbb"
exit repeat
end repeat
x --> item 1 of "aabbccbb"
set AppleScript's text item delimiters to x
AppleScript's text item delimiters --> "a"
text items of "aabbccbb" as text --> "bbccbb"
set AppleScript's text item delimiters to ASCII character (0)
But now do it like this:
set AppleScript's text item delimiters to ASCII character (0)
(*
repeat with x in "aabbccbb"
exit repeat
end repeat
x --> item 1 of "aabbccbb"
*)
set AppleScript's text item delimiters to item 1 of "aabbccbb"
AppleScript's text item delimiters --> "a"
text items of "aabbccbb" as text --> "aabbccbb" (Huh?)
set AppleScript's text item delimiters to ASCII character (0)
I don’t get it ” the meat of the algorithm seems the same to me either way, namely:
1st way: set AppleScript’s text item delimiters to x
vs.
2nd way: set AppleScript’s text item delimiters to item 1 of “aabbccbb”
Why doesn’t…
text items of “aabbccbb” as text
…the 2nd way strip out the first two characters of “aabbccbb”?
AppleScript’s text item delimiters read the same both ways (“a”).
What am I missing?