can you chek it please?

I copied this script from a book
and it’s not working

can you tell me what is the problem?

--part 1:
global messagelist

--part 2:
on run
	set messagelist to {"test 1", ¬
		"test 2", ¬
		"test 3"}
end run

--part 3:
on idle
	tell application "iChat"
		set the status to away
		set the status message to (some item of messagelist)
	end tell
	
	--part 4:
	return 600
end idle

thank you
Idan segal

You don’t say how it doesn’t work, but have you saved this script as a stay open application and then started it from its icon?

You absolutely right, I didn’t explain my self…

I saved this script as an application and run it, I waited until the computer
went idle. and watch on my status on another computer.
after 10 min my iChat status went idle and nothing happened.

So maybe I didn’t understand the book guide,
if the script is looking fine, can you explain me what should happen in this script?
What is “stay open application”?

Thanks
Idan

When you save a script as an application, the form (down at the bottom under File Format) presents three options: Run Only, Startup Screen, and Stay Open. Check Stay Open or the script will quit as soon as it finishes the “on run” handler, not “knowing” about the rest. [Don’t check “Run Only” or you won’t be able to edit the script again]