Note links in Evernote → OmniFocus script

I’ve cobbled together a script which, when run, will open OmniFocus’s quick entry box and add a new item for each note selected in Evernote, and which will add the Evernote note link as the OmniFocus note. (I use Keyboard Maestro to activate it with a keyboard shortcut.)

What I’d really like it to do is to add the note not as a plain link, but as a clickable link that says “Note” or whatever. How can I modify my script to do this?

tell application "Evernote"
set selectedNotes to (get selection)
repeat with oneNote in selectedNotes
	try
		set noteTitle to (title of oneNote) as string
		set taskTitle to "Act on " & noteTitle
		set noteLink to (note link of oneNote) as string
		tell application "OmniFocus"
			tell quick entry
				open
				make new inbox task with properties {name:taskTitle, note:noteLink}
			end tell
		end tell
	end try
end repeat
end tell

Thanks!

Try something like this:

set value of attribute named "link" of style of paragraph 1 of note of myTask to urlString
2 Likes

That’s great, thank you! New script with this incorporated is:

tell application "Evernote"
set selectedNotes to (get selection)
repeat with oneNote in selectedNotes
	try
		set noteTitle to (title of oneNote) as string
		set taskTitle to "Act on " & noteTitle
		set noteLink to (note link of oneNote) as string
		tell application "OmniFocus"
			tell quick entry
				open
				set newTask to make new inbox task with properties {name:taskTitle, note:"Note"}
				set value of attribute named "link" of style of paragraph 1 of note of newTask to noteLink
			end tell
		end tell
	end try
end repeat
end tell
5 Likes