The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Applescript to change the Project of a task? Thread Tools Search this Thread Display Modes
Hi there,

I would like to know how to be able to change the project for an existing task. I have looked through the dictionary and found that tasks have "Container", "Containing document", and "Containing project", however, these are read-only.

Does anyone know of a way to do that?
You can move a task into the task list of another project.

tell application id "OFOC"
	tell default document
		repeat with strName in {"ProjB", "ProjA"}
			set oProj to make new project with properties {name:strName} at beginning of projects
			repeat with strTask in {"First", "Second"}
				tell oProj to set oTask to make new task at end of tasks with properties {name:strTask & " task of " & name}
			end repeat
		end repeat
		move oTask to end of tasks of second project
	end tell
end tell

Last edited by RobTrew; 2011-12-19 at 05:22 AM..
RobTrew, that was such an obvious way of doing it... My brain was looking for the hardest way of doing it while the right answer is right there.

Thanks a lot for your help buddy!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Applescript error number -1728 when trying to specify a project name for a new task benlanghals OmniFocus Extras 3 2011-12-30 05:55 PM
Add quick entry task with project using AppleScript iNik OmniFocus Extras 2 2011-08-30 12:40 PM
change parent child task relationship with AppleScript cope360 OmniPlan Extras 2 2009-07-16 10:51 AM
AppleScript to change task dates aleding OmniFocus 1 for Mac 1 2008-05-11 02:16 PM
AppleScript help: Create sub-task, project from task iNik OmniFocus Extras 3 2007-12-05 08:53 AM

All times are GMT -8. The time now is 10:43 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.