I’m just going through items trying to expand on my AppleScript knowledge and I was experimenting with a simple script. I have used the statement:
display dialog b as string
where b is a list, on occasion, for troubleshooting purposes. I used this script:
set l to {"1", "a", "g", 2, 7, 9}
set b to {} as list
repeat with a in l
if class of a is integer then
set b's end to a
end if
end repeat
log (class of b)
display dialog (b) as string
and where the display dialog is, it just displays an empty dialog box (with the usual ok & cancel buttons). However, if I add “as list” to the end of “set b’s end to a”, the display dialog works as expected. Eventhough in both instances the class of b is a list, why is it that without the “as list” the dialog is empty?
PreTech