View Single Post
This slight extension allows for multiple selections in the Finder, ignores folders, and creates a URL link to the file in the note of the Omnifocus task.

The first draft did, however, reveal a minor bug in Omnifocus: the links do not immediately appear blue and clickable, only becoming so after the cursor has been placed on them, and the note has been opened and closed a few times.

The bug is probably worth reporting.

A solution is to add an alias after the URL, as below.

Code:
tell application "Finder"
	set lstSelected to selection
	if (count of lstSelected) > 0 then
		tell application "OmniFocus"
			activate
			set oDoc to front document
		end tell
		
		set strPath to POSIX path of (folder of front window as text)
		
		repeat with oSeln in lstSelected
			if class of oSeln is document file then
				tell oSeln
					set strName to name
					set strURL to URL
				end tell
				using terms from application "OmniFocus"
					tell oDoc
						set oTask to (make new inbox task with properties {name:"Read " & strName, note:strURL})
						tell note of oTask
							make new file attachment with properties {file name:strPath & strName}
						end tell
					end tell
				end using terms from
			end if
		end repeat
		
		tell application "OmniFocus" to activate
	end if
end tell

Last edited by RobTrew; 2008-02-25 at 12:35 PM..