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

Getting the path of a project Thread Tools Search this Thread Display Modes
I have been asked how one can get the full path of a project that may be nested within one or more folders.

The following snippet includes some elements that could be reused:
on run
	tell application id "OFOC"
		tell front document window of front document
			repeat with oPanel in {sidebar, content}
				set lstValue to value of (selected trees of oPanel where class of its value is project)
				set lngProj to count of lstValue
				if lngProj > 0 then exit repeat
			end repeat
			if lngProj < 1 then return
		end tell
	end tell
	set oProject to first item of lstValue
	set lstPath to ProjectPath(oProject)
	set {dlm, my text item delimiters} to {my text item delimiters, "/"}
	set strPath to lstPath as Unicode text
	set my text item delimiters to dlm
	set strPath to do shell script ("printf '%q' " & quoted form of strPath)
end run

on ProjectPath(oProject)
	tell application id "OFOC"
		tell oProject
			set lstPath to {name}
			set oContainer to container
		end tell
		repeat while class of oContainer is not document
			set beginning of lstPath to name of oContainer
			set oContainer to container of oContainer
		end repeat
	end tell
end ProjectPath
Thanks, Rob! Very useful to open support material folders from a mirrored hierarchy in Finder.
Hierarchy mirroring is, of course, a bit fragile. If we reorganise the folder hierarchy on either side (OF or file system) the link to the mirrored support folders is broken.

This is one of the reasons for which I now keep my support material for OmniFocus projects in corresponding DEVONthink folders, rather than in file system folders.

Current versions of these scripts do still initially create parallel folder hierarchies within DEVONthink, but the links between the folders and the OF projects are maintained by DT and OF hyperlinks, which are position-independent.

(DT urls are placed in the note field of the OF project, and the URL fields of DT records (folders/files) contain links back to the OF project).

This means that I can reorganize the nesting of my OF or DT folders without breaking the OF <--> DT links.


Last edited by RobTrew; 2011-09-08 at 11:52 AM..

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Critical Path - won't highlight path aboeing OmniPlan General 4 2014-04-09 12:49 PM
Sub-project critical path mfarmer OmniPlan General 1 2011-02-14 10:02 AM
Missing the whole project path HuConn OmniFocus for iPhone 2 2010-09-09 03:57 PM
The Path to being an OG Ninja bump OmniGraffle General 1 2010-07-14 09:45 AM
Critical Path MacBerry OmniPlan General 11 2009-03-15 07:36 AM

All times are GMT -8. The time now is 08:56 PM.

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