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

 
OmniFocus URI Handler (create tasks via URL) [See Omni note on pg 5!] Thread Tools Search this Thread Display Modes
Just a quick update. I changed the makeInboxTask function, a bit of a sloppily re-write, but it now works with a project:

Code:
on makeInboxTask(theName, theProject, theContext, theNote)
	tell application "OmniFocus" to tell default document
		set theTask to make new inbox task with properties {name:theName}
		if theNote is not missing value then set note of theTask to theNote
		if theContext is not missing value then set context of theTask to theContext
		
		if theProject is not missing value then
			set theProject to project theProject
			set assigned container of theTask to theProject
			compact
		end if
	end tell
end makeInboxTask
 
Re-write again for context:


Code:
on makeInboxTask(theName, theProject, theContext, theNote)
	tell application "OmniFocus" to tell default document
		set theTask to make new inbox task with properties {name:theName}
		if theNote is not missing value then set note of theTask to theNote
		
		if theContext is not missing value then
			set theContext to context theContext
			set context of theTask to theContext
		end if
		
		if theProject is not missing value then
			set theProject to project theProject
			set assigned container of theTask to theProject
			compact
		end if
	end tell
end makeInboxTask
 
Issues with Send to Quick Entry script:

In Firefox 3.6, if OF is hidden:
-Script calls QE and new task is created, but QE does not have focus. You must click on a field to edit or save, which calls the OF main window behind QE.

In Firefox 3.6, if OF is minimized or not the frontmost window:
-Script calls QE and new task is created, but QE does not have focus. You must click on a field to edit or save, which calls the OF Inspectors palette.

I believe this began after updating to Firefox 3.6. Similar behavior occurs in Safari 4.0.4, however. The only difference is that QE receives focus and the cursor is active in the Name field of the new task (but the OF main window or the Inspectors window is still called).

This has been observed in 1.7.5 and 1.8sp (v77.46 r126553)

(Incidentally, the Send to OF Quick Entry bookmarklet that was posted in the 1.8 sneaky peak thread does not function for me in Firefox 3.6, either. In Safari 4.0.4, it produces the same behavior as above. Feedback has been sent to the support ninjas).

Quote:
Originally Posted by jmca View Post
Nice job on the script!! 1 prob, for some reason it will not recognize the &project parameter. Everything works except that it ignores this parameter and chucks it in the inbox, both with quickentry 1 or 0.
Additionally, I'm not having the issue mentioned by jmca. New tasks created via QE are correctly placed in their assigned project and context.
 
NOTE: I've stopped developing this script because as of OF 1.8 (currently in SneakyPeekdom), this functionality is built-in through omnifocus://add URLs.

However, here is a snazzy bookmarklet that does the same thing with OF 1.8, including saving the selection. Just drag the link below to your toolbar:

Send to OF

Or the raw JS:

Code:
javascript:window.location='omnifocus:///add?note='+encodeURIComponent(window.location+'\n\n')+encodeURIComponent(getSelection())+'&name='+encodeURIComponent(document.title)

Last edited by iNik; 2010-05-26 at 02:50 PM..
 
We were contacted today by a developer wondering if this was the best way to satisfy their customers' request for adding "Send to OmniFocus" features to their app.

There's a different method which we would actually recommend; folks can read about it in this thread.

Just wanted to head off any potential future confusion at the pass. (Editing the thread title to that end, as well.)
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to BCC tasks to Omnifocus [A: use Omni Sync Server's "Mail Drop" feature.] isadore.braun OmniFocus 1 for Mac 1 2013-03-20 01:56 PM
Please take note Omni Group! Deedubau OmniFocus for iPhone 3 2012-10-16 11:54 AM
Script to locate tasks with a certain date in a note daltongreen OmniFocus Extras 4 2011-01-20 10:07 AM
Please add some type of note indicator to tasks oschultz OmniFocus for iPhone 5 2009-05-12 05:08 PM
Tasks failure (The Apple Event Handler Failed) wycats OmniFocus Extras 1 2007-11-23 09:04 PM


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


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