View Single Post
The script below will display a Growl note listing all selected actions. You can use the Growl system preference pane to configure the notification to be sticky and on all desktops. (An earlier version of this is kicking around on the forums.)

Code:
(*
	This script uses Growl to display a sticky note about what you are supposed to be focusing on.
	
	version 0.1, by Curt Clifton
	
	Copyright  2007-2008, Curtis Clifton
	
	All rights reserved.
	
	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
	
		 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
		
		 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
		
	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	
	version 0.1: Original release
*)


(*
	The following properties are used for script notification via Growl.
*)
property growlAppName : "OmniFocus Stickies"
property notification : "Stick it"
property defaultNotifications : {notification}
property allNotifications : defaultNotifications
property iconLoaningApplication : "OmniFocus.app"

tell application "OmniFocus"
	tell front document
		tell content of document window 1 -- (first document window whose index is 1)
			set theSelectedItems to name of every selected tree
			if ((count of theSelectedItems) < 1) then
				display alert "You must first select an item to work on." as warning
				return
			end if
		end tell
	end tell
end tell
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to return
set theItemsText to theSelectedItems as text
set AppleScript's text item delimiters to oldDelim
my notify("What are you doing?", theItemsText, notification)

(*
	Uses Growl to display a notification message.
	theTitle  a string giving the notification title
	theDescription  a string describing the notification event
	theNotificationKind  a string giving the notification kind (must be an element of allNotifications)
*)
on notify(theTitle, theDescription, theNotificationKind)
	tell application "GrowlHelperApp"
		register as application growlAppName all notifications allNotifications default notifications defaultNotifications icon of application iconLoaningApplication
		notify with name theNotificationKind title theTitle application name growlAppName description theDescription with sticky
	end tell
end notify
__________________
Cheers,

Curt