Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Leave iChat running. Toggle status instead.

  • Loading branch information...
commit 2bbb125bd3661d3eaf2e44c1d9c093ee9a6568e7 1 parent 7a386c7
@toolbear authored
Showing with 20 additions and 5 deletions.
  1. +20 −5 flow.d/001_iChat
View
25 flow.d/001_iChat
@@ -1,7 +1,22 @@
+on ApplicationIsRunning(appName)
+ tell application "System Events" to set appNameIsRunning to exists (processes where name is appName)
+ return appNameIsRunning
+end ApplicationIsRunning
+
on run argv
- if item 1 of argv is "diminish" then
- tell application "iChat" to log out
- else if item 1 of argv is "restore" then
- tell application "iChat" to log in
- end if
+ if not ApplicationIsRunning("iChat") then return
+
+ if item 1 of argv is "diminish" then
+ tell application "iChat"
+ set status to away
+ delay 0.1
+ set status message to "Pomodoro in Progress"
+ end tell
+ else if item 1 of argv is "restore" then
+ tell application "iChat"
+ set status to available
+ delay 0.1
+ set status message to ""
+ end tell
+ end if
end run
Please sign in to comment.
Something went wrong with that request. Please try again.