View Single Post
Thanks Curt, I haven't had the time to play with the dictionary for OmniFocus yet.

In this case, the script should be as follows:

tell application "OmniFocus"
tell front document
set theContext to the context "Mac"

-- Gets target context
tell content of document window 1 -- (first document window whose index is 1)
set theSelectedItems to value of every selected tree
if ((count of theSelectedItems) < 1) then
display alert "You must first select an item to complete." as warning
return
end if
repeat with anItem in theSelectedItems
if (class of anItem is project) then
set name of anItem to "AP, AR, Finance"
else
set due date of anItem to current date
end if
set context of anItem to theContext
end repeat
end tell
end tell
end tell