View Single Post
The completed property of projects used to have another bug, and may have been effectively disabled.

The trick seems to be to set the the status of a project, as in:
Code:
property missingNASuffix : "Missing NA"
property missingNADelimiter : "—"
property suffixToStrip : missingNADelimiter & missingNASuffix
property suffixLength : count of suffixToStrip

tell application "OmniFocus"
	tell front document
		tell document window 1
			set theSelectedItems to value of selected trees of content
			repeat with anItem in theSelectedItems
				tell anItem
					if (name ends with suffixToStrip) then
						-- set completed of anItem to true
						set status of anItem to done
						set newName to rich text 1 thru (-1 * (suffixLength + 1)) of (get name)
						set name to newName
					end if
				end tell
			end repeat
		end tell
	end tell
end tell

Last edited by RobTrew; 2009-07-30 at 09:55 AM..