View Single Post
DamonC,

Thanks. AppleScript has a kind of biblical cant, doen't it? Just lots of "ofs" instead of "begats"...

I'm tripping up now on setting the project. I tried a couple of different things, and didn't get anything to work. Here's the latest script. (I know that the selected item has no parent task, so I don't need to test for it with this script.) The error is:

Quote:
OmniFocus got an error: Can’t set name of missing value to "AP, AR, Finance".
tell application "OmniFocus"
tell front document
set theContext to the context "Online" of context "Mac"
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
set name of parent task of anItem to "AP, AR, Finance"
set context of anItem to theContext
set due date of anItem to current date
end repeat
end tell
end tell
end tell

In this case, "AP, AR, Finance" is in the folder "Operations & Finance" which is in the folder "Work" in "Library".

I tried "AP, AR, Finance" of parent task "Operations & Finance" of parent task "Work"... but I get this error:

Quote:
Expected end of line but found “"”
I'm sorry to be so dense. I'm told that AppleScript is great because it's just like English, only I don't speak that way!

Best,

Dave