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

 
Set new Start Date script? Thread Tools Search this Thread Display Modes
Does anyone know of a script that will simply push out the start date of an action (or project) to x hours from now?

I have a lot of active tasks, but there are some times when I know I'm not going to be able to get to something until some time in the future, so I'd love to be able to move them off my "Available" list with only a click or two.

I currently have (and use often!) Daniel Byler's Defer by days script, and modified it to also have a Defer by hours script, but since a majority of the actions I currently have do not have a start date, those scripts don't work. Additionally, if there is a start date, it's not easy to figure out how many days/hours I need to push it out to get it to be only an hour or two from now.

I'd love to have a way to do this quickly without having to manually modify the start date of the action(s) in question.

Anyone know where I might be able to find a way to do this? I've tried modifying the scripts mentioned above, but can't seem to figure out how to get them to do what I want... Or, do any of you have suggestions on a better workflow which provides similar results?

Any assistance would be greatly appreciated!
 
Me too :-) - but I would like an automatic way of setting start date the same as due date as i work mainly with the latter, and dont want to see all these items . Iknow that perspectives can filter out a lot of stuff but a quick script to set start date would be great.

Thanks!

___

Mark
 
Quote:
Originally Posted by flutegirl View Post
Does anyone know of a script that will simply push out the start date of an action (or project) to x hours from now?
Here is a rough sketch, which you may be able to adapt.

Code:
-- Ver 0.2 fixed bug
-- Set the start date of selected tasks/projects to N hours from now ...
-- (Prompts user for the number N)
on run
	set dblHours to GetNumber()
	set strReport to DeferSelected(dblHours)
	if length of strReport > 0 then display dialog strReport
end run

on DeferSelected(dblHours)
	tell application "OmniFocus"
		try
			set oWin to front window
		on error
			return
		end try
		
		set dteWhen to current date
		set hours of dteWhen to (hours of dteWhen) + dblHours
		
		set strReport to ""
		set lstTrees to selected trees of content of oWin
		repeat with oTree in lstTrees
			set oValue to value of oTree
			tell oValue
				set cClass to class
				if (cClass is task) or (cClass is project) then
					set start date to dteWhen
					set strReport to strReport & name & return
				end if
			end tell
		end repeat
		if length of strReport > 0 then
			set strReport to "Deferred start date of:" & return & return & strReport & return & "to:  " & (dteWhen as string)
		end if
	end tell
	return strReport
end DeferSelected

on GetNumber()
	tell (display dialog "Number of hours from now: " default answer "0")
		set strNum to text returned
	end tell
	
	try
		set dblNum to strNum as number
	on error
		display dialog strNum & " is not recognizable as a number"
		return missing value
	end try
	return dblNum
end GetNumber

Last edited by RobTrew; 2010-03-24 at 11:34 AM.. Reason: fixed bug
 
Thanks for sharing this, works great.

___
Mark
 
@RobTrew, did you change anything in the script other than adding comments? No matter what I enter for the hours, the start time is set to the current time.
 
Thanks Greg - I have fixed the bug now. (Ver 0.2 still above)
 
Works for me now-thank you!
 
Quote:
Originally Posted by RobTrew View Post
Here is a rough sketch, which you may be able to adapt.
Thank you, thank you, thank you!

That script is perfect, and does exactly what I was looking for!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to re-order selected items by start date barrettj OmniFocus Extras 2 2013-04-11 07:34 AM
Start date, Forecast Workarounds for missed start dates rdbot Applying OmniFocus 8 2013-04-04 01:56 PM
Making Start Date, Due Date, Estimate Default jessicatmt OmniFocus 1 for Mac 1 2012-08-06 02:23 PM
Complete and Await Reply Script - Pushes Start Date 2 Days kennedyma OmniFocus Extras 2 2011-06-17 01:57 AM
Problem with repeat when start date and due date exist SpiralOcean OmniFocus 1 for Mac 2 2008-09-05 05:43 AM


All times are GMT -8. The time now is 07:00 AM.


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