Growl Fortune?

The Growl forums have moved to Google Groups, this forum is read only.
Locked
User avatar
libwolf
Harmless
Posts: 11
Joined: Mon Dec 06, 2004 5:29 am
Location: Australia

Growl Fortune?

Post by libwolf »

Hi All,

I've very much a newbie with writing applescripts.

What I'd like to do is create a script that will get Growl to pop a Fortune onscreen.

I've been reading through the included scripts, but haven't had any luck yet.

Can someone point me in the right direction?

Thanks,
User avatar
bgannin
Growl Team
Posts: 1817
Joined: Thu Dec 02, 2004 8:11 am
Location: ..here
Contact:

Post by bgannin »

Try my software!

#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
User avatar
libwolf
Harmless
Posts: 11
Joined: Mon Dec 06, 2004 5:29 am
Location: Australia

Post by libwolf »

Thank you!

It works!

If anyone is interested here is the script I cludged together. Seems to work best with the Music Video Display.

And if anyone wants to give a few pointers how how I can improve it, it would be greatly appreciated.

Libwolf
User avatar
yelly
Crema
Posts: 292
Joined: Thu Sep 01, 2005 2:20 pm
Location: Jerusalem, Israel
Contact:

Post by yelly »

well done for a first timer :)
for starters, you will want to throw away all of the "another test notification" stuff, or I can just do it for you :)

Code: Select all

repeat 5 times
	set myText to do shell script "/sw/bin/fortune"
	
	
	tell application "GrowlHelperApp"
		-- Make a list of all the notification types 
		-- that this script will ever send:
		set the allNotificationsList to ¬
			{"Fortune"}
		
		-- Make a list of the notifications 
		-- that will be enabled by default.      
		-- Those not enabled by default can be enabled later 
		-- in the 'Applications' tab of the growl prefpane.
		set the enabledNotificationsList to ¬
			{"Fortune"}
		
		-- Register our script with growl.
		-- You can optionally (as here) set a default icon 
		-- for this script's notifications.
		register as application ¬
			"Fortune" all notifications allNotificationsList ¬
			default notifications enabledNotificationsList ¬
			icon of application "Terminal"
		
		--	Send a Notification...
		notify with name ¬
			"Fortune" title ¬
			"Fortune" description ¬
			myText application name "Fortune"
	end tell
end repeat
you may also want to change the icon for your script, possibly to a picture of a fortune cookie or something.
User avatar
libwolf
Harmless
Posts: 11
Joined: Mon Dec 06, 2004 5:29 am
Location: Australia

Post by libwolf »

Hey all,

Got to love the Pre-Christmas slowdown - gives me a chance to work on this.

I've been looking at AppleScript Support but can't get the icon to work.

Can someone point me to a script that has an external icon? Not a Application icon, but an actual picture?

Thanks in advance,

Libwolf
Locked