Iterate list with "property" OK Tiger not Panther?

property n_count : 1
set myList to {"A", " B", " C", " D", " E", "F", "G"}
set l_count to count items of myList
repeat until n_count = l_count + 1
	set list_i to item n_count of myList
	display dialog list_i buttons {"Up 1", "OK", "Down 1"} default button 2
	if button returned of result is "Up 1" then
		set n_count to n_count + 1
	else if button returned of result is "Down 1" then
		set n_count to n_count - 1
		set n_count to n_count + 1
		exit repeat
	end if
end repeat

Been a while since I posted but here you go…

The above works fine from Script Menu in Tiger but not Pather. It should iterate through the list 1 by 1, with the option of going forward and back, and remeber where it was last time it was run. In Panther it just keeps running from the begining of the list. Works fine if you run with SE open, but I want it to run from the Menu.


Cheers all,

Model: G5 and G4 powerbook
AppleScript: 2.1.1 and 2.0
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

The script menu has had a problem properly retaining properties. This was corrected with one of the 10.4 updates.

Edit: That was in 10.4.6, by AppleScript 1.10.6.

Thanks for the feedback Bruce.

For potential followers/searchers of the thread - I’ve found a workaround.


Seems to play ball using that as an alternative to the Script Menu :slight_smile:

There’s actually a simple vanilla workaround to this behaviour, David ” which is to return a value at the end of your script. It can be virtually any value you like:

… or anything else that might take your fancy. Since the script won’t actually use such a value, it won’t be affected ” apart, that is, from being able to remember the value of properties from one run to the next, when run from Script Menu. :slight_smile:

For some background to the identification of the bug (which survived into early versions of Tiger) and the workaround, you might want to check out this discussion: Script Menu in Tiger: non-persistent property bug?. (Messages should be listed in chronological order from bottom to top.)