Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'New mail notification using the PowerMate' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
New mail notification using the PowerMate
Authored by: olivesoft on Mar 16, '04 06:57:21PM
To make it so you don't need a crontask, make the AppleScript and Stay Open Application by choosing "Application" from the File Format popup in the Save As dialog and the "Stay Open" option. The "return 60" at the end of the idle handler will cause it to be executed every 60 seconds. This way, you can just add it to your Login Items (or Startup Items in Panther) instead of having to rerun it every minute. on idle try tell application "System Events" to if (exists process "Mail") is false then set theCount to 0 else tell application "Mail" to set theCount to unread count of in mailbox end if if theCount > 0 then tell application "PowerMateDriver" to set pulse always to true else tell application "PowerMateDriver" set pulse always to false set brightness to 0 end tell end if end try return 60 end idle

---
-Bob
---------------------
I tend to think of [Mac] OS X as Linux with QA and Taste.
-James Gosling, Java Architect

[ Reply to This | # ]

New mail notification using the PowerMate
Authored by: olivesoft on Mar 16, '04 07:00:54PM
Sorry for the formatting...

on idle
	try
		tell application "System Events" to if (exists process "Mail") is false then
			set theCount to 0
		else
			tell application "Mail" to set theCount to unread count of in mailbox
		end if
		if theCount > 0 then
			tell application "PowerMateDriver" to set pulse always to true
		else
			tell application "PowerMateDriver"
			        set pulse always to false
			        set brightness to 0
	     end tell
        end if
    end try
    return 60
end idle

---
-Bob
---------------------
I tend to think of [Mac] OS X as Linux with QA and Taste.
-James Gosling, Java Architect

[ Reply to This | # ]