iChat Auto Away

This is a little script I wrote to change your away message in iChat to 5 different messages of your choice, with a delay time of your choice. It’s small and simple, but someone may find it useful:


display dialog "Welcome To The iChat Auto Away Program!"
display dialog "Please enter message #1: " default answer ""
set message1 to text returned of the result as string
display dialog "Please enter message #2: " default answer ""
set message2 to text returned of the result as string
display dialog "Please enter message #3: " default answer ""
set message3 to text returned of the result as string
display dialog "Please enter message #4: " default answer ""
set message4 to text returned of the result as string
display dialog "Please enter message #5: " default answer ""
set message5 to text returned of the result as string

display dialog "Please enter a delay between messages:" default answer ""
set delay_time to text returned of the result as string

tell application "iChat"
	set status to away
end tell

repeat 1000000 times
	tell application "iChat"
		set status message to message1
		delay delay_time
		set status message to message2
		delay delay_time
		set status message to message3
		delay delay_time
		set status message to message4
		delay delay_time
		set status message to message5
		delay delay_time
	end tell
end repeat

Feel free to edit it anyway you want. In fact, if you do mess with it and make it better, share it. One thing I couldn’t get is how to make repeat go on an infinite loop. I tried repeat -1 times, but that didn’t work. If anyone knows how, do tell.

Have Fun :smiley:

this will repeat forever (just use “repeat”) and it will ask again if you enter non-numbers for the delay time

display dialog "Welcome To The iChat Auto Away Program!"
display dialog "Please enter message #1: " default answer ""
set message1 to text returned of the result as string
display dialog "Please enter message #2: " default answer ""
set message2 to text returned of the result as string
display dialog "Please enter message #3: " default answer ""
set message3 to text returned of the result as string
display dialog "Please enter message #4: " default answer ""
set message4 to text returned of the result as string
display dialog "Please enter message #5: " default answer ""
set message5 to text returned of the result as string


repeat
	display dialog "Please enter a delay between messages:" default answer ""
	try
		set delay_time to text returned of the result as number
		exit repeat
	on error
		--
	end try
end repeat

tell application "iChat"
	set status to away
end tell

repeat
	tell application "iChat"
		set status message to message1
		delay delay_time
		set status message to message2
		delay delay_time
		set status message to message3
		delay delay_time
		set status message to message4
		delay delay_time
		set status message to message5
		delay delay_time
	end tell
end repeat

I was trying to unlimit the limit of 5, and make it unlimited, following me?
Basically, it would ask wut my 1st would be, and I would set the name of it to message & (current number) and i could continue, anyone have an idea how to get past this?

set (message & aaa) to text returned of Againss

so basically it wants to rewrite aaa into the variable, but i want it ignore the rewrition, and just put the growing number in…
Message1
Message2

Here is the whole thing tho:

set aaa to 1
set again to "Another!"
repeat until again is equal to "That's enough"
	set Againss to display dialog "Please enter message #" & aaa & ": " default answer "" buttons {"That's enough", "Another!"} default button 2
	set (message & aaa) to text returned of Againss
	set again to button returned of Againss
	if again = "Another!"
		set aaa to aaa + 1
	end if
end repeat
repeat
	set Timeees to display dialog "Please enter a delay between messages:" default answer "" buttons {"Hours", "Minutes", "Seconds"} default button 2
	try
		set delay_time to text returned of Timeees
		exit repeat
	on error
		--
	end try
	set Timees to button returned of Timeees
	if Timees = "Hours" then
		set delay_time to delay_time * 360
	else if Timees = "Minutes" then
		set delay_time to delay_time * 60
	end if
end repeat
tell application "iChat"
	set status to away
end tell
repeat
	set aa to 1
	tell application "iChat"
		repeat until aa = aaa
			set status message to (message & aa)
			delay delay_time
			set aa to aa + 1
		end repeat
	end tell
end repeat

I understand why this doesn’t work, but anyone know how to make it work?