• Announcements

    • Shane D.

      Evernote Webinars   12/01/2017

      We've recently begun conducting Evernote Webinars for various topics and subjects. Take a look at the Calendar to check them out, and see if they interest you! Keep an eye out as there will be more to come in the future!
  • 1
CoreParadox

Create jump links in your notes with ELIN!

Idea

I created a simple java app elegantly named Evernote Link In Note aka ELIN. It is free and open source, you can check it out here.



This is just a simple app to easily genereate a jump for evernote notes, easily copy and paste into your note and style them how you please, and they should work. For example, if you have a rather large note and wanted to link the word "conclusion" to the bottom of your page where you have a header that said "conclusion" this app generates html that you can easily copy and paste into your note. Then you simply click the link and it will automatically scroll to the destination that the app generated!


Current Release: v1.1 - 4/25/15 

  • Like 2

Share this post


Link to post

46 replies to this idea

Recommended Posts

  • 0

I don't think it's the EN 6.0.10, it's probably due to the funkyness of the workflow itself (the implementation is far from ideal).

 

A few things to check:

1. Is the note you are editing opened in a separate window?

2. If not, is the note shown as the first item in the note list in the main window?

 

The awkwardness comes from the fact that I don't see a easy and definite way to get "the current note in the main window" via applescript. The workflow sort of assumes that use is editing the note in a separate window, or the note list in the main window is sorted by "updated time".  I've updated the workflow (gist) to include a dialog asking user to confirm that the script has the right idea about which note is being editing currently.

 

 

Why don't you just use this code to get the Note which is selected:

I've been using it a long time, and it works well.

tell application "Evernote"		set _sel to selection -- Gets the Note(s) Selected in Evernote	if _sel ≠ {} then		set aNote to first item of _sel -- Get ONLY the 1st Note		-- Process the selected Note	end ifend tell

Share this post


Link to post
  • 0

 

My bad again, totally didn't think of compatibility issues. I re-wrote the workflow in AppleScript which should be supported in Mavericks (I think? I don't have access to a Mavericks machine at this moment so I cannot verify) and updated the gist. Would you be interested in trying it out?

 

Fantastic!  It works very well in Mavericks (10.9.5) with EN Mac 6.0.7.

 

Thank you so much for all your patience and quick responses to my posts.

 

May I make one suggestion?  Instead of pasting the link, how about just leaving it on the clipboard and displaying a popup dialog to that effect?  Then the user to go to the desired location and paste it, rather than having to cut and paste.

 

Thanks again.  This is a huge addon feature for EN Mac.

 

May I request another addon?

 

Often this need for an internal link/bookmark comes up because it was originally setup as part of a real web page.

Would it be possible to select a group of lines (like you would have in an internal TOC for a web page), and then convert them to the proper links needed to goto the anchors/bookmarks that, hopefully, already exist in the EN Note?

 

Here is an example web page that contains a TOC at the top, with links to lots of anchors/bookmarks below:

https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_fundamentals.html#//apple_ref/doc/uid/TP40000983-CH218-SW2

 

Maybe you could do a EN web clip of this page, and then convert the TOC links?

 

The problem with leaving link in the pasteboard is... the workflow would not be able to run the "sanitizing" process as it has to happen AFTER the link is pasted into Evernote, because Evernote adds the "evernote-html-snippet://" when the link is pasted.

 

The trouble with the "restoring TOC" idea is it would require operating on the HTML and doing quite a few modification of the raw HTML content, and I'm a bit hesitant about the idea for general users, and more imporantly, I don't think this process could be implemented as a workflow or system service easily because we would need to traverse the html and do quite a few string replacements.  With JavaScripts (NodeJS + cheeriojs + AppleScript) or Ruby (rails + Nokogiri + AppleScript) or Python it's simple enough (a few short scripts), but it's kind of another long story to talk about installing dev environments, various module dependencies, etc.

Share this post


Link to post
  • 0

Why don't you just use this code to get the Note which is selected:

I've been using it a long time, and it works well.

tell application "Evernote"		set _sel to selection -- Gets the Note(s) Selected in Evernote	if _sel ≠ {} then		set aNote to first item of _sel -- Get ONLY the 1st Note		-- Process the selected Note	end ifend tell

That's a very good idea, I missed that part about "selection" from the official document, thanks! I just updated the workflow with the snippet.

  • Like 1

Share this post


Link to post
  • 0

That's a very good idea, I missed that part about "selection" from the official document, thanks! I just updated the workflow with the snippet.

 

Thanks.  I'll give it a try.

Share this post


Link to post
  • 0

 

Why don't you just use this code to get the Note which is selected:

I've been using it a long time, and it works well.

tell application "Evernote"		set _sel to selection -- Gets the Note(s) Selected in Evernote	if _sel ≠ {} then		set aNote to first item of _sel -- Get ONLY the 1st Note		-- Process the selected Note	end ifend tell

That's a very good idea, I missed that part about "selection" from the official document, thanks! I just updated the workflow with the snippet.

 

 

@frogwell:

 

I took a look at your revised Applescript code for Note selection, and I don't understand it.

Why still use your original approach of "set currentNote to item 1 of notes of window 1"?

Couldn't this still lead to selection of the wrong Note?

 

Seems like all you need is the selection code:  "set currentNote to first item of _sel -- Get ONLY the 1st Note"

 

What am I missing?

tell application "Evernote"		set noteCount to count of notes of window 1		set currentNote to missing value		if noteCount is equal to 1 then			set currentNote to item 1 of notes of window 1		else			set _sel to selection -- Gets the Note(s) Selected in Evernote			if _sel ≠ {} then				set currentNote to first item of _sel -- Get ONLY the 1st Note				-- Process the selected Note			end if		end if		if currentNote is missing value then			return		end if

Share this post


Link to post
  • 0

 

That's a very good idea, I missed that part about "selection" from the official document, thanks! I just updated the workflow with the snippet.

 

Thanks.  I'll give it a try.

 

 

OK, I have tested on one Note in EN Mac 6.0.10 and 6.0.6, and both worked fine.

 

FYI, I setup my Notes so that the Note I tested was NOT the first Note in the Note list to make sure that your code was using the correct Note for the "sanitizing".  It worked!

 

I'm still a bit concerned about the Note selection AppleScript code, but it worked OK in my limited testing.

 

BTW, I renamed the Automator Service to "EN Create Bookmark" to help identify it as an Evernote service and to use the HTML "bookmark" term.

 

Thanks again for sharing this Automator Workflow/service, and for all your help in making it work for my environment.

 

Now that the basic code/process is working, are you open to enhancement requests?

I would do them myself, but I know nothing about Ruby and the other code/scripts you used.

But I would be glad to be your Beta tester.   ;)

Share this post


Link to post
  • 0

 

 

That's a very good idea, I missed that part about "selection" from the official document, thanks! I just updated the workflow with the snippet.

 

Thanks.  I'll give it a try.

 

 

OK, I have tested on one Note in EN Mac 6.0.10 and 6.0.6, and both worked fine.

 

FYI, I setup my Notes so that the Note I tested was NOT the first Note in the Note list to make sure that your code was using the correct Note for the "sanitizing".  It worked!

 

I'm still a bit concerned about the Note selection AppleScript code, but it worked OK in my limited testing.

 

BTW, I renamed the Automator Service to "EN Create Bookmark" to help identify it as an Evernote service and to use the HTML "bookmark" term.

 

Thanks again for sharing this Automator Workflow/service, and for all your help in making it work for my environment.

 

Now that the basic code/process is working, are you open to enhancement requests?

I would do them myself, but I know nothing about Ruby and the other code/scripts you used.

But I would be glad to be your Beta tester.   ;)

 

You are absolutely right about "selection". I sort of hastily scrawled the code earlier today without reading the documentation carefully. Still the code should work just fine, though. Because I put the "set currentNote to item 1 of notes of window 1" statement INSIDE an IF statement, so it will only be excuted if the frontmost Evernote window is a separate note window (which contains precisely one note). But since apparently "selection" refers to the frontmost window already, the IF statment is not necessary. I've updated the gist to reflect the change, but the workflow's behavior isn't really affected.

 

I'll take a look at the dependencies of my scripts tomorrow before posting them. It doesn't really do the "select a bunch of lines" thing as you described, instead it runs through all links in the note and try to identify those linking to in-page bookmarks/anchors and format them so their href's start with "#", and making sure the destination has a proper <a name="label">destination text</a> tag.

  • Like 1

Share this post


Link to post
  • 0

 

My bad again, totally didn't think of compatibility issues. I re-wrote the workflow in AppleScript which should be supported in Mavericks (I think? I don't have access to a Mavericks machine at this moment so I cannot verify) and updated the gist. Would you be interested in trying it out?

 

Fantastic!  It works very well in Mavericks (10.9.5) with EN Mac 6.0.7.

 

Thank you so much for all your patience and quick responses to my posts.

 

May I make one suggestion?  Instead of pasting the link, how about just leaving it on the clipboard and displaying a popup dialog to that effect?  Then the user to go to the desired location and paste it, rather than having to cut and paste.

 

Thanks again.  This is a huge addon feature for EN Mac.

 

May I request another addon?

 

Often this need for an internal link/bookmark comes up because it was originally setup as part of a real web page.

Would it be possible to select a group of lines (like you would have in an internal TOC for a web page), and then convert them to the proper links needed to goto the anchors/bookmarks that, hopefully, already exist in the EN Note?

 

Here is an example web page that contains a TOC at the top, with links to lots of anchors/bookmarks below:

https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_fundamentals.html#//apple_ref/doc/uid/TP40000983-CH218-SW2

 

Maybe you could do a EN web clip of this page, and then convert the TOC links?

 

So here's a piece of JavaScript code that does a bit of "TOC clean up" (gist), I tried it with a clipped note from the webpage you provided and it seems to work fine. Short story is that the script invokes a subprocess in AppleScript to obtain the HTML content of target note, goes through the html and replace all links of the form "https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/conceptual/ASLR_fundamentals.html#//apple_ref/doc/uid/TP40000983-CH218-SW1"to "#//apple_ref/doc/uid/TP40000983-CH218-SW1" if it finds another element that matches this link in the note, and then invoke another AppleScript subprocess to update the target note's HTML content. It should work with the two most commonly seen TOC implementation on web (one is a pair of <a> tags, the other is an <a> tag with href pointing to another element via the 'id' property).

 

It's a command line tool (not an automator workflow). You don't need Yosemite for this, but you do need Node.JS, npm and a few node modules. Those are very popular javascript developer libraries so you should be able to find instructions on how to install them easily (this for example), if you really want to try it out. I would probably do:

 

$ brew install node

$ npm install -g temp

$ npm install -g cheerio

 

then download the en-toc-cleanup.js script and run

$ node en-toc-cleanup.js <note link>

with the <note link> replaced by the actual note link to your target note.

 

Share this post


Link to post
  • 0

So here's a piece of JavaScript code that does a bit of "TOC clean up" (gist), I tried it with a clipped note from the webpage you provided and it seems to work fine.

 

Many thanks for your code and effort.  I really appreciate it.

 

While I would much like to dig into this deeper and get into "developer mode", I just don't have time right now.

But if you can package this into a simple download/install, I would be happy to beta test it for you.

Share this post


Link to post
  • 0

This is brilliant, thank you so much.  There are a ton of people who want anchor support in Evernote and this program does it.

Share this post


Link to post
  • 0

Hi, I just started using your jump2link windows app & it allows me to perform internal note linking that was sorely needed in Evernote.Desktop

It works great!

Would it be possible to change one step in you're program?

Instead of scrolling down to the "destination link", Could you insert the cursor at that location following the "header link",

The problem is in Evernote the cursor remains at the jump link after a edit.

This would save time and confusion.

Thanks for your effort.!

 

 

 

 

Share this post


Link to post
  • 0
On 4/25/2015 at 5:46 PM, CoreParadox said:

I created a simple java app elegantly named Evernote Link In Note aka ELIN. It is free and open source, you can check it out here.

Current Release: v1.1 - 4/25/15 

CoreParadox, I love ELIN! I find it more difficult to implement than you might imagine, in that some perfectly good (as far as I know) jump links never work, or stop working after a few days, but when it works, it's fabulous!

I have no idea how it works. you say it generates the destination in the form <a name="#infolink">Info Section</a> but i never see that. As far as i can tell, the Destination Text is plain text. Still I do select it and paste it into my evernote, even if the text already existed. I can't get ELIN to work without creating by pasting the Destination Text immediately after adding the hypertext Link Text. Then I have to close that evernote and sync, and if I'm lucky, when I go back to that note, the ELIN Jump links work.

You say the Jump Name must be unique to that evernote, but i don't seem to be able to reuse a Jump Name that I'm not using any more. I have 2 Jumps that the Link Text and Destination Text are the same word, "BVC" (they are different places, #8 and #9 in a list) and ELIN jumps to the right place just fine!

So thanx for ELIN!

Share this post


Link to post
  • 0

I'm hoping this is the right forum for my question - I've just realised that when I clip a webpage like Wikipedia that has internal hyperlinks (i.e. for footnotes), when I click on these links in the EN note, instead of moving to the relevant place in the note (the reference at the bottom of the page, which *is* clipped as part of the whole website), it takes me back to the browser and reloads the webpage. I understand that in this case the hyperlink is set to a Wikipedia URL, but would it not be a fairly simple add-on feature that links get altered in clipping so that they refer internally to the note? Or would this be too big a task?

Appreciate your advice. I'm running EN Version 6.11 Beta 2 on Mac OS Sierra, clipping from Chrome using the Clipper plugin.

Share this post


Link to post
  • 0
32 minutes ago, benimadimben said:

I'm hoping this is the right forum for my question - I've just realised that when I clip a webpage like Wikipedia that has internal hyperlinks (i.e. for footnotes), when I click on these links in the EN note, instead of moving to the relevant place in the note (the reference at the bottom of the page, which *is* clipped as part of the whole website), it takes me back to the browser and reloads the webpage. I understand that in this case the hyperlink is set to a Wikipedia URL, but would it not be a fairly simple add-on feature that links get altered in clipping so that they refer internally to the note? Or would this be too big a task?

Appreciate your advice. I'm running EN Version 6.11 Beta 2 on Mac OS Sierra, clipping from Chrome using the Clipper plugin.

Hi.  You're posting in a thread about a completely separate application.  You should create a new post if you have a specific question like this.  In this case however there's no chance that Evernote could translate the links on the fly so you can jump around the page within Evernote.  You're probably best off saving a bookmark clip and reading the original page online.  You could suggest this as a feature request if you wish...

Share this post


Link to post
  • 0

Thanks @gazumped. I'll consider a feature request. As a follow-up, I've noticed that some websites seem to be able to easy translate their URL hyperlinks to internal links when you download an article from its HTML version for offline reading - see for one example this one (at the top select 'Print' then save as pdf). So I'm not sure why it would be so out of the realm of possibility for EN...

Share this post


Link to post
  • 0
36 minutes ago, benimadimben said:

As a follow-up

As @gazumped said, you should not be tacking on to this discussion
Start a discussion of your own, and I'd be happy to discuss your points

Share this post


Link to post
  • 0

CoreParadox: I would LOVE to use this. I followed your link but there was a message about your ENIL being inactive. Can you share with me, please. This would make my life SO much easier. Thank you! :)

Share this post


Link to post
  • 0
12 minutes ago, kristinj said:

CoreParadox: I would LOVE to use this. I followed your link but there was a message about your ENIL being inactive. Can you share with me, please. This would make my life SO much easier. Thank you! :)

https://github.com/CoreParadox/EvernoteLinkInNote/releases

From there you can just download the .exe or .jar, but i'm no longer using Evernote so I have no intention to update or improve this app. If you would like to maintain it feel free to make pull requests.

Share this post


Link to post
  • 0

Thank you, CoreParadox! 

Might I ask what you're using now? Also, I don't know how to install something like this-- how do I know whether to download the .exe or .jar? I'm on a Mac with OS X, if that helps. :)

Share this post


Link to post
  • 0
6 minutes ago, kristinj said:

Thank you, CoreParadox! 

Might I ask what you're using now? Also, I don't know how to install something like this-- how do I know whether to download the .exe or .jar? I'm on a Mac with OS X, if that helps. :)

For Mac, you would have to download the .jar file, you would also need java installed on your system, which it may already be. But I can't say for sure if the app still works correctly, it was a really sloppily hacked together app anyhow. But I messaged you what I'm using now, since I found it distasteful to post on Evernote's forums.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now