Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AchillesII

macrumors newbie
Original poster
Sep 20, 2009
1
0
After working on this problem for over an hour, I still can't figure out how to get the number of items in a list - and display that number in a text field. For some reason this code doesn't work (though it should) and is the same code that I normally use for regular AppleScript. This code when run displays a "the variable stringNum is not defined" error though the var stringNum is clearly defined below.

Code:

property theString : {"a", "b"}
on clicked theObject
set stringNum to number of items of theString
set contents of text field "textField" to stringNum
end clicked

Thanks in advance...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.