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

 
Send selected Finder document to OF inbox as task Thread Tools Search this Thread Display Modes
Hi,

I often find myself needing to read/review a document that's sitting somewhere on my disk.

Rather than putting all the documents needing a review to a "To be reviewed" folder, I decided to try put toghether a quick and dirty script to help me with that, inspired by Curt Cliftons Send URL to OF.

The script gets the name of the selected Finder documents and creates an OF task in the inbox called "Read XXX:YYY:ZZZ.pdf".

Ideally:
  • the task name should just be the file name, without the full path
  • the task note should contain the alias to the file
  • the script should check if one document is selected, and not a folder
but that's beyond my non-existent knowledge of Apple Script.

Maybe you'd like to add this functionality.

Code:
-- Written by Marek Kowalczyk, inspired by Curt Clifton

property actionPrefix : "Read "

tell application "Finder"
	set theName to the selection
end tell

tell front document of application "OmniFocus"
	make new inbox task with properties {name:(actionPrefix & theName)}
end tell
 
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..
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Script - Selected Entourage EMail to Selected OF Task davidsomeone OmniFocus Extras 1 2009-03-06 12:22 PM
Send to Inbox from Safari Chris OmniFocus 1 for Mac 3 2008-04-17 12:41 AM
Wanted: Send Selected Contexts to Email steve OmniFocus Extras 9 2007-12-08 06:35 AM
Mail (selected lines) to Inbox RobTrew OmniFocus Extras 0 2007-09-29 03:43 AM
Send Task / Receive Task update by Email samaparicio OmniFocus 1 for Mac 0 2007-07-10 07:58 PM


All times are GMT -8. The time now is 06:36 AM.


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