Code to change the project of a task

What is the proper syntax for changing a task’s PROJECT in OF2? Would it not be:

set project of thisItem to defaultProject

I’m wanting a simple script to move selected item(s) to an “Archive” project. Thanks! Ralph

In my script, at the top, “defaultProject” is defined as “Archive,” the project to which I would like to move items using the script.

I think you have to dig a bit in to the AppleScript dictionary. At first blush, I would say that you have to work with the name of the project. I would not promise this works, but I might suggest it as a first step to the expansion that will be required …

set the name of (the project with name thisItem) to defaultProject

I also have no idea whether you can assign a project to a different name by just (re)setting the name or whether you have to use some other action verb to do the work, for example …

move (the project with name thisItem) to (the project with name defaultProject)


JJW