Tip: How to stop tasks jumping around big lists when adding to fields. (And my merge script)

TLDR: Use Sort By Added

I use OF to capture everything. Often 50-100 items per day. From inbox, I then merge them (using a script) and send them to live in a project or tag.

Over time those lists get unwieldy. Especially the “just tagged, no project” tasks / perspectives. Often they contain redundant info (because I captured the same thought “I should fix x” multiple times)

When you try to tidy a perspective with hundreds of items, by adding to the Project field, for example, the task will jump to auto-sort by project. Even if the perspective is “ungrouped” and “sort by tag” (or any of the other sort-bys).

This jumping drives me nuts. Because now I lost my place in the list I was tidying. I have to visually scan the hundred+ tasks to find where I was.

The most reliable way to keep them from jumping is to use Sort By Added. Date Added is a set-in-stone piece of data. If you use any other sort, they will auto jump to projects (or somewhat randomly)

Here’s that merge script I use multiple times/day. It’s not pretty but it works 97% of the time. Merges title to title, and note to note.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

-- Combine two or more selected tasks into one
tell application "OmniFocus"
	tell document window 1 of default document
		set _trees to selected trees of content
		if (count of _trees) < 2 then
			display dialog "You must have more than one task selected"
			set _tasksToDelete to {}
			set _masterTask to value of item 1 of _trees
			set _names to "" & name of _masterTask
			set _notes to note of _masterTask
			repeat with i from 2 to count of _trees
				set _task to value of item i of _trees
				set end of _tasksToDelete to _task
				## this prefixes a hyphen. don't delete the quotes
				set _names to _names & return & "- " & name of _task
				## notes
				if note of _task is not "" then
					set _notes to _notes & return & "----------------------" & return & "***" & return & "- " & note of _task
				end if
			end repeat
			set note of _masterTask to _notes
			set name of _masterTask to _names
			delay 1
			repeat with _task in _tasksToDelete
				delete _task
				delay 1
			end repeat
		end if
	end tell
end tell