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

Manually adjusting start date with a repeating task Thread Tools Search this Thread Display Modes
I have a repeating task (repeat every 3 months). However, when enter or change a start date, it appears as though the next start date shifts 3 months as well.

What I'd like to have happen is that the task's due date repeats at the end of every quarter, but the start date can be changed independently. For example, lets say it is next due 9/30 and the current start date is today, 7/7. I complete the task today, and the next start date should be 10/1. Instead what it appears to do is create the next start date of 10/7. In other words, I only want to push the start date back this cycle.

Any advice or is this a limitation?



Only problem is the single-shot duplicate's original due date shifts with the start date. Any way the due date can persist?

Everything else looks great. Thanks!

Oh, I forgot that the script also adjusted the due date! So you want the task to retain its original due date, and just shift the start date?

You could replace this line:
					tell oTask to set {start date, due date} to {newStartDate, newDueDate}
with this line:

					tell oTask to set start date to newStartDate
and I think you would get the desired result (start date adjusted, due date left as it was).
Tried it and got "Failed to reschedule existing task"


It did everything correct up to changing the duplicated start date.

Last edited by LLBean; 2012-07-07 at 07:02 PM..
Before I waste any more of our time, let's make sure I'm correctly understanding what you want to do. You have a task which is normally starting 7/1, due 9/30, repeat every 3 months. You want to change it this time around to start on 7/7, but still keep the due date and repeat intact. Is that correct?

I'm puzzled as to why the code is getting that error. Can you take a snapshot of the inspector showing the repeating action before you try running the script? I haven't been able to reproduce it.
Repeating task, current start date 7/1, current due date 9/30.

What I want is to be able to change the current start date without affecting the start date of the next iteration. So if I change the current start date to 7/9, the start date for the next iteration will remain 10/1, not 10/9, which is OF current behavior. Due date remains the same, either 9/30 for the current iteration or 12/31 for the next.

Not sure why the revised code returned an error code.

I appreciate the help-

Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-07-07 at 11.27.20 PM.png
Views:	216
Size:	33.7 KB
ID:	2457  
If it helps, here is revised code-
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-07-07 at 11.40.05 PM.png
Views:	218
Size:	87.7 KB
ID:	2458  
Ah, that does help you've changed the wrong line. The line to be changed is inside the "if (canReschedule) then" statement. Your version sets the start date before calculating the value of newStartDate, and that causes an error.

Here's the entire routine:

on RescheduleRepeatingTask(oTask)
	using terms from application "OmniFocus"
		set completed of oTask to true -- cause OmniFocus to duplicate task
		set repetition of oTask to missing value -- clear repeat
		set canReschedule to false
		if (pOffertoReschedule is true) then
			display dialog "Reschedule by how many days?" buttons {"Cancel", "OK"} 
				default button 2 default answer "1"
			set rescheduleDays to (text returned of the result) as integer
			-- attempt to move start and due dates back by rescheduleDays
				tell oTask to set {theStartDate, theDueDate} to {start date, due date}
				set {newStartDate, newDueDate} to {theStartDate, theDueDate}
				if (theDueDate is not missing value) then
					set newDueDate to (theDueDate + (days * rescheduleDays))
					set canReschedule to true
				end if
				if (theStartDate is not missing value) then
					set newStartDate to (theStartDate + (days * rescheduleDays))
					set canReschedule to true
				end if
				if (canReschedule) then
					tell oTask to set start date to newStartDate
					display alert "No start or due date for existing task, duplicated but not rescheduled"
				end if
			on error
				display alert "Failed to reschedule existing task"
			end try
		end if
		set completed of oTask to false -- reactivate original task
	end using terms from
end RescheduleRepeatingTask
Works like a charm! Thanks again!!!!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start date, Forecast Workarounds for missed start dates rdbot Applying OmniFocus 8 2013-04-04 12:56 PM
Selecting Remaining task ONLY past start date Elderen OmniFocus for iPad 7 2013-02-28 02:04 PM
Repeating Tasks... Don't want it to show until start date. adk365 OmniFocus 1 for Mac 4 2008-12-12 09:47 AM
Repeating actions sorted by start date upon completion - status? stormy OmniFocus 1 for Mac 2 2008-08-29 04:47 AM
Hide task until start date? brooce OmniFocus 1 for Mac 3 2007-06-25 11:22 AM

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

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