using terms from application "Colloquy"
on process user command theCommand with theArguments for theView
if theCommand is "gone" or "away" then
tell theView to send message "is away: " & theArguments to theView with action tense
do shell script "defaults write com.Colloquy.awayscript 'awaym' '" & theArguments & "'"
do shell script "defaults write com.Colloquy.awayscript 'awayt' '" & (current date) & "'"
end if
if theCommand is "back" then
if (do shell script "defaults read com.Colloquy.awayscript 'awaym'") is "" then
add event message "You were not away"
end if
if (do shell script "defaults read com.Colloquy.awayscript 'awaym'") is not "" then
tell theView to send message "is back: " & (do shell script "defaults read com.Colloquy.awayscript 'awaym'") with action tense
do shell script "defaults write com.Colloquy.awayscript 'awaym' ''"
end if
end if
end process user command
end using terms from