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 Today's Posts

 
Evernote and AppleScript Thread Tools Search this Thread Display Modes
Quote:
Originally Posted by whpalmer4 View Post
Am I correct in thinking that you want to select a bunch of items, and have them clipped and turned into several individual items as one operation?
You are correct. This works great from Omni Outliner. But as I use more and more Evernote, I want to be able to highlight all my actions items and turn them into individual tasks in my inbox. If they all have the same name, I have to re-type in each the content that it's in the notes. If it's one it's not big deal, but when you have 10 or 15 actions and this happens several times a day, it no longer works as a solution.

Thanks.
 
Quote:
Originally Posted by Tinchohs View Post
You are correct. This works great from Omni Outliner. But as I use more and more Evernote, I want to be able to highlight all my actions items and turn them into individual tasks in my inbox. If they all have the same name, I have to re-type in each the content that it's in the notes. If it's one it's not big deal, but when you have 10 or 15 actions and this happens several times a day, it no longer works as a solution.

Thanks.
I would like to see better Evernote and Omnifocus integration.
 
A very rough first draft of a script to import the notes selected in the Evernote OS X application GUI to a series of OmniFocus tasks, either in the Inbox, or in a date-stamped import folder.

(In this draft the notes come across as plain text. It's easy enough to get a formatted RTF version into the clipboard, but I haven't spent enough time on it to detect an obvious route from the clipboard into the rich text of the OF note).

[I don't use Evernote, so this draft is offered out of curiosity, as a rough suggestion, but may not be much supported or developed]

Code:
-- Ver 0.2

-- Rough draft of a script to import selected EverNote notes to OF

-- If the following property is set to false, a date-stamped import folder is created
-- containing a project (named after the relevant Evernote notebook) which in turn contains the selected items

-- If it is set to true, the imported items will be placed in the OF Inbox

property pblnToInBox : false

on run
	set lstEv to EvNoteSeln()
	PlaceInOF(lstEv)
end run

on EvNoteSeln()
	tell application id "com.evernote.Evernote"
		set lstSeln to selection
		if length of lstSeln > 0 then
			
			tell front notebook
				set lstEv to {its name}
				repeat with oNote in lstSeln
					tell note id (local id of oNote)
						set end of lstEv to {title, HTML content}
					end tell
				end repeat
			end tell
			return lstEv
		end if
		{}
	end tell
end EvNoteSeln

on PlaceInOF(lstEv)
	
	set lngNotes to length of lstEv
	if lngNotes > 1 then
		set dte to current date
		
		tell application id "com.omnigroup.omnifocus"
			tell front document
				if pblnToInBox then
					
					repeat with i from 1 to lngNotes
						set {strTitle, strHTML} to item i of lstEv
						set the clipboard to strHTML
						set strTxt to my GetText()
						set oTask to make new inbox task with properties {name:strTitle, note:strTxt}
					end repeat
				else
					
					set oFolder to make new folder with properties {name:"Evernote Import " & dte as string}
					tell oFolder
						set oProj to make new project with properties {name:first item of lstEv}
					end tell
					tell oProj
						repeat with i from 2 to lngNotes
							set {strTitle, strHTML} to item i of lstEv
							
							set the clipboard to strHTML
							set strTxt to my GetText()
							set oTask to make new task with properties {name:strTitle, note:strTxt}
						end repeat
					end tell
				end if
			end tell
		end tell
	end if
end PlaceInOF

on GetText()
	(do shell script "pbpaste | textutil -format html -convert txt -stdin -stdout") & return
end GetText

Last edited by RobTrew; 2010-11-27 at 02:18 AM.. Reason: Restored code
 
Rob, thanks so much. I tested it and have the following question. Would it be very hard to make the script just copy the highlighted text within the note, and place it as the OmniFocus task name? That would really do it for me. Thanks so much for your help.
 
The Evernote applescript library doesn't give access to the sub-selection within the text.

You might be able to use System Events to trigger a Cmd-C .
Once text is in the clipboard it is effectively available to Applescript, and through pbPaste, to the command line.

--

Last edited by RobTrew; 2010-11-19 at 09:46 AM..
 
Hi.

I was wondering if an evernote document with task checkboxes unchecked could have the individual tasks sync'ed with omnifocus. Most of the tasks I generate in a day are resolved that day. Things that aren't completed at the end of the day I would like to sync with omnifocus. Any ideas?

Thanks.

-Ed
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
Omnifocus with Evernote ciwa OmniFocus 1 for Mac 95 2013-10-22 12:59 PM
Send OF item to EverNote (AppleScript exist?) ende OmniFocus 1 for Mac 0 2011-11-08 10:10 AM
Mailing outline to Evernote drfrot OmniOutliner for iPad 2 2011-06-21 02:49 PM
Support for Evernote rbl OmniWeb Feature Requests 8 2010-10-26 03:43 PM
OmniFocus and Evernote ToddPeperkorn Applying OmniFocus 1 2009-10-09 03:55 PM


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


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