Clock Alert

The Growl forums have moved to Google Groups, this forum is read only.
Locked
User avatar
thelouisguy
Latté
Posts: 68
Joined: Fri Apr 01, 2005 8:27 pm
Location: Montreal
Contact:

Clock Alert

Post by thelouisguy »

I put together this simple applescript to alert me the time at a given interval of time.

I wasn't able to make the script run at a given interval of time so I just used CronniX to set up a crontab to run this script every 15 minutes. You can also do this using the terminal, but CronniX is so easy to use ;-)

Code: Select all

copy the (current date) to theDate
copy the time string of (theDate) to theTime
copy the date string of (theDate) to theCurrentDate

tell application "GrowlHelperApp"
	set the allNotificationsList to ¬
		{"Current Time"}
	set the enabledNotificationsList to ¬
		{"Current Time"}
	
	register as application ¬
		"Clock Alert" all notifications allNotificationsList ¬
		default notifications enabledNotificationsList ¬
		icon of application "WindowClock"
	
	notify with name ¬
		"Current Time" title ¬
		theTime as string description ¬
		theCurrentDate as string application name ¬
		"Clock Alert"
end tell
You can also save it as an app.

I'm by no means a professional, but I use this script every 15 minutes so I thought I might share it.
User avatar
John Don
Frappa
Posts: 238
Joined: Mon Dec 06, 2004 3:58 pm
Location: North Carolina

Post by John Don »

That's a very useful script! However, I was wondering if you might be able to help me configure CronniX. I copied your script into Script Editor, saved it as an application, then loaded the application into CronniX. I can manually run the script from CronniX's "Task" menu bar, but it doesn't seem to want to run when I try to create a schedule for it. I'd like my Script to run on the hour, but so far my efforts have proved fruitless. When I open the "Edit" option, I insert [ /usr/bin/open "/Applications/Current Time.app" ] into the "Command" box. I then place a checkmark beside "Hour" into the Schedule above. I then click "Apply", then I "Save", then I quit CronniX. Any idea what I could be doing wrong to keep my scheduler from executing? Thanks! :)
I'm... kinda tired... I think I'll go home now.

-Forrest Gump


I'm an Adiumite!
User avatar
thelouisguy
Latté
Posts: 68
Joined: Fri Apr 01, 2005 8:27 pm
Location: Montreal
Contact:

Post by thelouisguy »

You can just paste
"/Applications/Current Time.app"
into the Command box.

This has to be in a System Crontab event, and not a User event. I do not know why, but that have been my experience. You must have admin access. Click File, Open System Crontab.

Try this and let me know
User avatar
John Don
Frappa
Posts: 238
Joined: Mon Dec 06, 2004 3:58 pm
Location: North Carolina

Post by John Don »

thelouisguy wrote:You can just paste
"/Applications/Current Time.app"
into the Command box.

This has to be in a System Crontab event, and not a User event. I do not know why, but that have been my experience. You must have admin access. Click File, Open System Crontab.

Try this and let me know
That was the problem. I had been setting it as an User Event. Setting it as a System Event made it work! Thanks man, you have a very useful script! :D
I'm... kinda tired... I think I'll go home now.

-Forrest Gump


I'm an Adiumite!
User avatar
thelouisguy
Latté
Posts: 68
Joined: Fri Apr 01, 2005 8:27 pm
Location: Montreal
Contact:

Post by thelouisguy »

Does anybody know what to get the icon that appears in Growl notifications to display the current time? Right now, my clock alert script just gets the icon for apples clock app. the default time on it is 6 o'clock. So, any time the notification pops up, it displays the current time in text where text normally goes, but the icon always says 6 o'clock.
It's not big deal, but it would make this script even more aesthetically pleasing.
User avatar
John Don
Frappa
Posts: 238
Joined: Mon Dec 06, 2004 3:58 pm
Location: North Carolina

Post by John Don »

thelouisguy wrote:Does anybody know what to get the icon that appears in Growl notifications to display the current time? Right now, my clock alert script just gets the icon for apples clock app. the default time on it is 6 o'clock. So, any time the notification pops up, it displays the current time in text where text normally goes, but the icon always says 6 o'clock.
It's not big deal, but it would make this script even more aesthetically pleasing.
That would be nice :)
I'm... kinda tired... I think I'll go home now.

-Forrest Gump


I'm an Adiumite!
Locked