Thread: Combining Tasks
View Single Post
If you also wanted to preserve formatting you could back-up your data and then experiment with something like the following:

Code:
tell application id "com.omnigroup.omnifocus"
	tell content of front document window of front document
		set lstTasks to value of selected trees where (class of its value is task)
		if length of lstTasks < 2 then return
		set oFirstTask to first item of lstTasks
		set lstRest to items 2 thru end of lstTasks
		
		tell oFirstTask -- INSERT TITLE OF FIRST TASK AT START OF ITS OWN NOTE
			insert name & return & return at before characters of note
			duplicate last character of note to after last character of note
			insert return & return at before last character of note
			delete last character of note
			
			repeat with oTask in lstRest -- APPEND TITLES AND NOTES OF OTHER TASKS TO NOTE OF FIRST TASK
				duplicate last character of note to after last character of note
				insert ((return & return & (name of oTask) as string) & return & return) at before (last character of note)
				delete last character of note
				duplicate (characters of note of oTask) to after (characters of note)
				delete oTask
			end repeat
		end tell
	end tell
end tell