The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Snooze button Thread Tools Search this Thread Display Modes
Like many OF users, I use flagged actions to mark which actions I want to complete right away.

When I interviewed Ken Case a while ago, he passed along another tip: Use the start date as a "snooze button" to push actions a little bit into the future. I often do that at two-hour intervals.

So at any give time I have about a dozen flagged actions on my radar, and if I want to narrow the focus further, I'll select 9 of them or so and set their start time two hours in the future.

How about adding an actual snooze button to OmniFocus? When clicked, it would set the start date of the selected task or tasks to a user-configurable time in the future? The user would set the time interval in the "Preferences" pane.

Just a thought.
 
You might try using or modifying the postpone script linked to in the Extras forum.
 
Thanks, Lucas - I've been searching for that script for some time and I'm not finding it. Link, please?
 
The script is called "Defer", not postpone. See this thread.
__________________
Cheers,

Curt
 
The defer script has been helpful and worked for me
 
Thanks. I haven't been able to modify it to get it to work to my satisfaction -- indeed, after I modified it it didn't work at all.

I'm looking for one button that, when pressed, changes the start date of an action item or project to three hours in the future.
 
This seems to work passably well:

Code:
(*
	This script takes the currently selected actions or projects and defers, or "snoozes", them by the user-specified number of days.
	The user may snooze just the due date or both the start and due dates (useful for skipping weekends for daily recurring tasks).
	
	version 0.1, by Dan Byler
	
	Copyright  2008, Daniel N. Byler  (contact: dbyler@gmail.com)
	
	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

	Installation: Copy to ~/Library/Scripts/Applications/Omnifocus
 	If desired, add to the OmniFocus toolbar using View > Customize Toolbar... within OmniFocus

	Known bugs:
		 When the script is invoked from the OmniFocus toolbar and canceled, OmniFocus returns an error. This issue does not occur when invoked from the script menu, a Quicksilver trigger, etc.

*)

property showAlert : true --if true, will display success/failure alerts
property useGrowl : true --if true, will use Growl for success/failure alerts
property defaultSnooze : 3 --number of hours in the future to restart by default

property alertItemNum : ""
property alertDayNum : ""
-- property successTot : 0
property growlAppName : "Dan's Scripts"
property allNotifications : {"General", "Error"}
property enabledNotifications : {"General", "Error"}
property iconApplication : "OmniFocus.app"


tell application "OmniFocus"
	tell front document
		tell (first document window)
			set theSelectedItems to selected trees of content
			set numItems to (count items of theSelectedItems)
			if numItems is 0 then
				set alertName to "Error"
				set alertTitle to "Script failure"
				set alertText to "No valid task(s) selected"
				my notify(alertName, alertTitle, alertText)
				return
			end if
			
			display dialog "Snooze for how many hours?" default answer defaultSnooze buttons {"Cancel", "OK"} default button 2
			set snoozeLength to (the text returned of the result) as integer
			if snoozeLength is not 1 then
				set alertDayNum to "s"
			end if
			set modifyStartDate to true
			set selectNum to numItems
			set successTot to 0
			repeat while selectNum > 0
				set selectedItem to value of item selectNum of theSelectedItems
				set succeeded to my setNewStartDate(selectedItem, snoozeLength, modifyStartDate)
				if succeeded then set successTot to successTot + 1
				set selectNum to selectNum - 1
			end repeat
			set alertName to "General"
			set alertTitle to "Script complete"
			if successTot > 1 then set alertItemNum to "s"
			set alertText to successTot & " item" & alertItemNum & " deferred " & snoozeLength & " hour" & alertDayNum as string
		end tell
	end tell
	my notify(alertName, alertTitle, alertText)
end tell

on setNewStartDate(selectedItem, snoozeLength, modifyStartDate)
	set success to false
	tell application "OmniFocus"
		if modifyStartDate is true then
			set theStartDate to current date
			if (theStartDate is not missing value) then
				set newStart to (theStartDate + (hours * snoozeLength))
				set start date of selectedItem to newStart
				set success to true
			end if
		end if
	end tell
	return success
end setNewStartDate


on notify(alertName, alertTitle, alertText)
	if showAlert is false then
		return
	else if useGrowl is true then
		tell application "GrowlHelperApp"
			register as application growlAppName all notifications allNotifications default notifications enabledNotifications icon of application iconApplication
			notify with name alertName title alertTitle application name growlAppName description alertText
		end tell
	else
		display dialog alertText with icon 1
	end if
end notify
Put it in the toolbar and you've got your button. I didn't attempt to rework the selection handling code, which still seems to be a bit persnickety about where you've last clicked before invoking the script.
 
Works quite well. Thanks!
 
FYI, there's an updated version of the script. If anyone's been using it, the new one has better handling of multiple items & notifications.

http://bylr.net/3/2008/02/omnifocus-defer-script/
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Snooze" Alarms? Chris Lawes OmniFocus 1 for Mac 1 2012-11-28 02:30 PM
Defer (or 'snooze') tasks/projects dbyler OmniFocus Extras 37 2011-08-29 05:26 PM
Snooze (not "defer") tasks/projects dbyler OmniFocus Extras 0 2009-02-26 06:59 PM
New Tab Button Dark_Athena OmniWeb Feature Requests 3 2008-04-12 01:42 PM
One button to update them all... spalkot OmniWeb Feature Requests 1 2008-03-09 08:13 PM


All times are GMT -8. The time now is 10:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.