Hi,
I am attempting to loop through the items in a list which is a list of strings. In the two loops shown below both run and read values from the list but only the second returns the string directly. In the first loop the variable tEventText is set to what appears to be a command e.g. item 2 of {"stringA","stringB","stringC"}
Whereas the second version that uses the index i resolves the string value directly. Is this an artefact of looking at the variables using ScriptDebugger or is this what AppleScript does?
###### First loop appears to return a command that gets processed when used ######
repeat with tEventText in tTodaysEvents
set tTextColour to my GetEventTextColour(tEventText)
set end of tText to {font:pfont, size:pCalEventTextSize, color:tTextColour, alignment:left, text:tEventText}
end repeat
###### This loop returns the string ######
set tEventCount to count of tTodaysEvents
repeat with i from 1 to tEventCount
set tEventText to item i of tTodaysEvents
set tTextColour to my GetEventTextColour(tEventText)
set end of tText to {font:pfont, size:pCalEventTextSize, color:tTextColour, alignment:left, text:tEventText}
end repeat
Both versions appear to run at similar speed with short lists but in my opinion debugging is simplified by using the second form.