An interesting note on this problem.
My original script was …
repeat with i from 1 to (count items of toList) if i > 2 then exit repeat item i of toList try ((name of the result) as Unicode text) & " <" & ((address of the result) as Unicode text) & ">" on error "<" & ((address of the result) as Unicode text) & ">" end try set toShortList to toShortList & {the result} end repeat
This worked in Snow Leopard which I was using until late October when I got a new Mac mini and began using Lion. I have checked my mail archives and the text "missing value" first appeared in late October. The reason seems to be that the script above no longer errors in Lion.
I replaced the 'try error' block with this …
repeat with i from 1 to (count items of toList) if i > 2 then exit repeat (item i of toList) {(name of the result), "<" & ((address of the result) as Unicode text) & ">"} if item 1 of the result = missing value then item 2 of the result else (item 1 of the result as Unicode text) & space & (item 2 of the result) end if set toShortList to toShortList & {the result} end repeat
fixing the problem by avoiding 'try error'. This seems to reinforce recent warnings about using 'try error'. But is it a bug? A Mail bug or an AppleScript bug?
|