The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   How to make a task nonrepeating? (http://forums.omnigroup.com/showthread.php?t=11928)

scb 2009-04-13 06:15 AM

How to make a task nonrepeating?
 
I know that a nonrepeating task returns "missing value" when the repetition field is queried, but how do I [U]specify[/U] that a task be nonrepeating? I've tried a number of things, for example

[CODE]set repetition of thetask to null[/CODE]

but none of these seem to work. Suggestions?

curt.clifton 2009-04-13 06:30 AM

Have you tried 'set repetition of theTask to missing value'?

(Untested.)

scb 2009-04-13 07:59 AM

[QUOTE=curt.clifton;58483]Have you tried 'set repetition of theTask to missing value'?

(Untested.)[/QUOTE]

Yes, that worked, thanks!

My original goal was to duplicate a task an then make the duplicate nonrepeatable. However, when I tried this:
[CODE]set newTask to duplicate aTask to after aTask with properties {repetition:missing value}
[/CODE]
That didn't work, causing me to (incorrectly) give up on using the "missing value" term.

skillet 2011-09-14 12:27 PM

[QUOTE=scb;58489]Yes, that worked, thanks!

My original goal was to duplicate a task an then make the duplicate nonrepeatable. However, when I tried this:
[CODE]set newTask to duplicate aTask to after aTask with properties {repetition:missing value}
[/CODE]
That didn't work, causing me to (incorrectly) give up on using the "missing value" term.[/QUOTE]

scb did you ever get this to work? I would love to use this!

scb 2011-09-15 04:04 AM

[QUOTE=skillet;101818]scb did you ever get this to work? [/QUOTE]

Yes, the code I used successfully is this:

[CODE]set newTask to duplicate theTask to after theTask
set repetition of newTask to missing value[/CODE]

skillet 2011-09-15 06:06 PM

Do you have an example of the complete script you are using by chance? Also does the script only work if run in Project view?

Check out post 8 by Bill!
[url]http://forums.omnigroup.com/showthread.php?t=22073[/url]

scb 2011-09-16 02:43 AM

[QUOTE=skillet;101863]Do you have an example of the complete script you are using by chance? Also does the script only work if run in Project view?

Check out post 8 by Bill!
[url]http://forums.omnigroup.com/showthread.php?t=22073[/url][/QUOTE]

Here's code that will copy a list of selected tasks , or an individual task, to non repeating and remove flags if any. The original task is marked as completed.

It works for me in context and project modes.


[CODE]tell application "OmniFocus"
activate
tell default document
set FrontWindow to first document window whose index is 1
tell FrontWindow

if ((count of leaves of selected trees of content) is 0) then
set theItems to value of selected trees of content
else
set theItems to (value of leaves of selected trees of content) as list
end if


repeat with anItem in theItems
if (class of anItem) is list then
repeat with subItem in anItem
if (class of subItem is task) then

set newitem to duplicate subItem to after subItem
set repetition of newitem to missing value
set flagged of newitem to false
set completed of subItem to true

end if
end repeat

else if (class of anItem is task) then
set newitem to duplicate anItem to after anItem
set repetition of newitem to missing value
set flagged of newitem to false
set completed of anItem to true

end if
end repeat
end tell
end tell
end tell
[/CODE]

skillet 2011-09-16 04:37 PM

This is great, thanks for sharing!

See post 8 in the following link. It might also be of use to someone searching this topic.

[url]http://forums.omnigroup.com/showthread.php?p=101930#post101930[/url]


All times are GMT -8. The time now is 10:36 PM.

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