Jump to content
  • 1

Extract selection into a linked note


Maxim Golov

Idea

Apologies if this was posted already, a search did not bring up anything. Here is the idea description:

It would be great if I could select some of the content in a note, press a shortcut and a new note is created with the content selected. The selection in current note is replaced with a link to the new note.

The title may be generated automatically from the content or a prompt may be displayed.

This would allow to quickly refactor larger notes while keeping the link with the parent.

  • Like 1
Link to comment

3 replies to this idea

Recommended Posts

  • 1
  • Level 5*
On 6/5/2020 at 1:18 PM, Maxim Golov said:

It would be great if I could select some of the content in the note, press a shortcut and a new note is created with the selected content. The content in current note is replaced with a link to the new note.

  This would be useful - I upvoted

fwiw  I can script this on my Mac (Applescript)   
I'd also insert a back-link in the new note

edit: Here's my use case for this feature
        I type entries throughout the day in my daily journal note
        At the end of the day review, I need to move the entries to a separate note - tags, reminder etc

Link to comment
  • 0
11 minutes ago, DTLow said:

fwiw  I can script this on my Mac (Applescript)

I am on Mac as well and would love to test that. Have not touched Applescript myself so far so looking for a free ride 😂

Link to comment
  • 0
  • Level 5*
On 6/5/2020 at 1:35 PM, Maxim Golov said:

I am on Mac as well and would love to test that.

I posted some Applescript basics at https://discussion.evernote.com/topic/112316-scripting-on-a-mac-applescript/

Here"s the basic script   ExtractSelection.scpt
and addresses the following steps

  1. Instructions to the Evernote app
            tell application "Evernote"
                 activate

     
  2. Save the original note and the selected text (replace the selected text with [Holder]
                 
    set theOriginalNote to item 1 of (get selection)
                 
    tell application "System Events" to keystroke "c" using {command down}
                 
    delay 1
                 
    set selectedText to the clipboard
                 
    tell application "System Events" to keystroke "[Holder]"
                  delay 1

     
  3. Get the title for the new note
                 
    set theTitle to item 1 of (paragraphs of selectedText)
                 set theTitle to (text returned of (display dialog "Title" default answer theTitle))

     
  4. Create the new note, get the link
                  
    set theNewNote to create note title theTitle with text selectedText
                  
    set theLink to note link of theNewNote as text
                  set theLinkHTML to "<a href=\"" & theLink & "\">" & theTitle & "</a>"

     
  5. Back to the original note, replace [Holder] with the link
                 
    delay 1
                 
    set theHTMLCode to HTML content of theOriginalNote
                  
    set theHTMLCode to my Replace_Text(theHTMLCode, "[Holder]", theLinkHTML)
                  set HTML content of theOriginalNote to theHTMLCode
Link to comment

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
×
×
  • Create New...