Move task to TOP of a project's list of tasks

I found a script that moves a task to the “end of” a Project. Is there a way to move said task to the TOP of that project’s list of tasks?

Here’s the current line of script
move _action to end of tasks of destination

Thanks!

I don’t have my Mac available to extract the code, but here is a script from the old forum that does the trick you are looking for:
Move to Top/Bottom

Hey, I’ve been using this script often to move items from the bottom to the top of a project and have noticed that i sometimes have an issue where it will ungroup (and scramble) nested tasks when it moves them to the top (which makes it very sloppy and time consuming to re-order).

Could anybody please help me figure out why this is happening and how to fix it? It seems to happen often when i am sending multiple nested tasks up to the top of the project at the same time. Does anyone have any idea why it happens or have experience with this issue?

Btw: i’m pretty sure that this is the script that i am using, but it is possible that i got the script from elsewhere and misremembered which script i’m using, so here is the script just in case:


tell application “OmniFocus”
tell content of document window 1 of default document
set taskList to get value of selected trees
repeat with aTask in taskList
set theProject to containing project of aTask
move aTask to beginning of tasks of theProject
–move aTask to end of tasks of theProject
end repeat
end tell
end tell


and here’s a screenshot of the same script- i’m not sure if it makes it easier to view as text or a screenshot so thats why im including both

1 Like