Created
September 26, 2012 20:31
-
-
Save carlosefonseca/3790415 to your computer and use it in GitHub Desktop.
Connects/Disconnects a certain IM account (like for work) on both Adium and Messages. A context-aware app runs the scripts automatically when I arrive at home/work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
if (name of processes) contains "Adium" then | |
tell application "Adium" | |
set acc to (some account whose name is "#####") | |
tell acc | |
set enabled to true | |
go online | |
end tell | |
end tell | |
end if | |
if (name of processes) contains "Messages" then | |
tell application "Messages" | |
log in (first service whose name is "#####") | |
end tell | |
end if | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
if (name of processes) contains "Adium" then | |
tell application "Adium" | |
set acc to (some account whose name is "#####") | |
tell acc | |
go offline | |
end tell | |
end tell | |
end if | |
if (name of processes) contains "Messages" then | |
tell application "Messages" | |
log out (first service whose name is "#####") | |
end tell | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment