Page 1 of 1

Growl Fortune?

Posted: Mon Dec 18, 2006 3:11 am
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,

Posted: Mon Dec 18, 2006 4:43 am
by bgannin

Posted: Mon Dec 18, 2006 6:35 am
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

Posted: Mon Dec 18, 2006 4:37 pm
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.

Posted: Tue Dec 19, 2006 4:03 am
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