Skip to content

Instantly share code, notes, and snippets.

@danieroux
Created February 7, 2012 10:12
Show Gist options
  • Save danieroux/1758934 to your computer and use it in GitHub Desktop.
Save danieroux/1758934 to your computer and use it in GitHub Desktop.
tell application "System Events" to if exists process "Adium" then
tell application "Adium"
set account_list to every account
repeat with acc in account_list
set stat to status of acc
set status type of acc to available
set status message of acc to "Available."
set autoreply of stat to no
end repeat
end tell
end if
tell application "System Events" to if exists process "ichat" then
tell application "iChat"
set status to available
set status message to "Available."
end tell
end if
tell application "System Events" to if exists process "Skype" then
tell application "Skype"
send command "SET USERSTATUS ONLINE" script name "My Script"
end tell
end if
tell application "System Events" to if exists process "Mail" then
tell application "Mail"
set account_list to every account
repeat with acc in account_list
set include when getting new mail of acc to true
end repeat
check for new mail
end tell
end if
tell application "System Events" to if exists process "Adium" then
tell application "Adium"
set account_list to every account
repeat with acc in account_list
set stat to status of acc
set status type of acc to away
set status message of acc to "I will be available in
$duration minutes."
set autoreply of stat to yes
end repeat
end tell
end if
tell application "System Events" to if exists process "ichat" then
tell application "iChat"
set status to busy
set status message to "I will be available in $duration minutes."
end tell
end if
tell application "System Events" to if exists process "Skype" then
tell application "Skype"
send command "SET USERSTATUS DND" script name "My Script"
end tell
end if
tell application "System Events" to if exists process "Mail" then
tell application "Mail"
set account_list to every account
repeat with acc in account_list
set include when getting new mail of acc to false
end repeat
end tell
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment