Compartilhar via


A really great tip to make getting information into OneNote much easier

  • While I greatly prefer to create content for my blog rather than linking to other blogs, this tip from Justin Knight is just far too handy to overlook.

  • Before I get into it, I want to give you the sales pitch. Suppose you are reading some document on your computer. There is some content (text, images, whatever) that you want to copy into OneNote. The current workflow would go something like:

    1. Highlight the content you want to copy
    2. CTRL+C to copy to the system clipboard (or use a context menu)
    3. Switch focus to OneNote
    4. Paste into OneNote
    5. Switch back to the application you were using.
  • Wow. 5 steps to gather the information you want. Wouldn't it be easier to do this with one keystroke?

  • And that is exactly what Jordan came up with. He uses AutoHotKey to create a "macro" to do all of the above in one keystroke. He gave away his code at his blog.

  • Here's what I did to get it to work in case you haven’t used this tool before (I had not - thanks for the tip, Jordan!).

    1. Downloaded the setup program from AutoHotKey
    2. Started AutoHotkey when done (I read the quick start first, but this is just the simplest directions to get this installed for you).
    3. The top of Notepad looked this:
    4. clip_image001
  • I replaced the link to the website right after the z:: with the text from Jordan's blog. I left the bit that reads:

  • -----------------

  • ^!n::

  • IfWinExist Untitled - Notepad

  • WinActivate

  • else

  • Run Notepad

  • return

  • ----------------------

  • intact, as well as the text below it. Then I saved the file and restarted AutoHotKey.  I got its green icon in my taskbar:

  • Now to test it. I started Notepad and highlighted some text. I pressed WINDOWS+Z and the highlighted text was placed right on the active OneNote page.  Focus came back to the application I was using to test (notepad) and the selection there was intact.  Awesome!

  • Next, over to the www.cnn.com\technology page and highlight some random subset of it. WINDOWS+Z -> BAM!

  • Jupiter's stormy Great Red Spot is shrinking

  • Everything about Jupiter is super-sized, including its colorful, turbulent atmosphere. But there's fresh evidence that one of the planet's most recognizable features, the Great Red Spot, is shrinking. It is possible that the giant storm may one day disappear, astronomers say. full story

  • Pasted from <https://www.cnn.com/TECH/>

  • (notice you also get the link from the web page, and notice that the layout got messed up when I posted this to my blog).  This took a few seconds on my very slow machine.

  • Nice work, Jordan! And kudos to the team at AutoHotKey - this is a slick application.

  • I'm including the full text of the autohotkey file if you want. It's below under my signature.

  • Just open it, select it all and paste it overthe autohotkey.ahk file contents after step 3 above.

  • Questions, comments, concerns and criticisms always welcome,

  • John

AutoHotkey.ahk.txt

Comments

  • Anonymous
    April 02, 2009
    I can't seem to get this to work on Windows 7.  Have you tested it there yet?

  • Anonymous
    April 03, 2009
    I had problems running this on Vista Home Premimum.  To resolve this (at least temporarily) I changed the command 'SendPlay' to 'Send' and that seemed to get it going.  There are some threads about a SendPlay issue on the Autohotkey forums.  Haven't had time yet to see if there is a better solution out there.

  • Anonymous
    April 03, 2009
    Fleon:  yes, I tested with Win7.  It worked for me.  Shot in the dark: did you restart AHK after replacing the text in the default file and saving it? Kurt: thanks for the tip on the Send/SendPlay command.  I tried on my Vista machine and it worked as posted, though.

  • Anonymous
    April 03, 2009
    John -- thanks for the directions I would not have tried to attempt this, if you hadn't posted these directions. It seems to run better with out the notepad text that you left in (repeated below). Deleting that text resulted in my being able to run the shortcut without having Notepad open.   ^!n:: IfWinExist Untitled - Notepad WinActivate else Run Notepad return

  • Anonymous
    April 03, 2009
    Hmm.  Notepad does not need to be running on any of my machines to use WINDOWS+Z to send to OneNote....  Deleting that text should only remove the shortcut key to launch notepad (or bring it into focus if it is already running).  Looks like that command could also be repurposed to bringing OneNote to the foreground (Windows+N already opens a new sidenote).

  • Anonymous
    April 03, 2009
    To remove the dependency of having OneNote running in the background and to paste the selected text on a separate page in Unfiled Notes we can piggy back on the OneNote side note feature ( This must be enabled - check if pressing Win Key + N launches a OneNote SideNote) ... The modified script is below : winTitlePart := "Untitled page - Microsoft Office OneNote" ; title of sideNote ON windows Send, ^c ; Copy currently selected stuff WinGetTitle, actWin, A ; Save the currently active window title Send, #n ; launch onenote side note WinWait, %winTitlePart% ,,5 ; wait maximum of 5 seconds for side note to launch ; If OneNote is not active, activate it now IfWinNotActive, %winTitlePart% WinActivate, %winTitlePart% ; Check again, if ON active then paste else error IfWinActive, %winTitlePart% { ; Paste to ON & Add some blank lines Send, ^v`r ; Use sendplay to avoid unexpected interactions with Win key WinClose, %winTitlePart% ; close the side note window ; Switch window back to previously active WinActivate, %actWin% } else MsgBox, Could not activate OneNote window. return

  • Anonymous
    April 03, 2009
    Good work, Ani!  This is a great addon to AHK.

  • Anonymous
    April 06, 2009
    I spent the last week showing everyone I could how slick Jordan's AutoHotKey script for OneNote is. Thanks

  • Anonymous
    April 06, 2009
    Thanks for this, John. I reposted it at iheartonenote.com

  • Anonymous
    April 06, 2009
    Here is my  version windows+c=create new note in unfiled notes windows+shift+c=create a new note under selected section #c:: { SendPlay, ^cr Sleep, 50 Run &quot;PATH TOUnfiled Notes.one&quot; Sleep, 50 WinActivate, ahk_class Framework::CFrame Sleep, 50 SendPlay, ^nr Sleep, 50 SendPlay, ^vr return } #+c:: { SendPlay, ^cr Sleep, 50 WinActivate, ahk_class Framework::CFrame SendPlay, ^nr Sleep, 50 SendPlay, ^vr return }

  • Anonymous
    April 22, 2009
    Hey, this is really helpful. I've been using  thanks the Firefox clip to onenote extension to pull info of the web, but this works a whole lot better because now, I can save to a current page or a new page within a current section. Awesome. Something tells me that the Firefox extension probably functions similarly to a macro created within AutoHotkey (copying text, then opening sidenote, then pasteing.) It's unfortunate the FF extension offers no option to customize send to destinations. How much different is the "send from IE" powertoy, from the Firefox extension, or a AutoHotkey macro. How difficult would it be to build a send to powertoy for FF? Where would be a good place to start reading about tools, techniques, etc for building a "generic send to" powertoy? Have a good one.  

  • Anonymous
    April 23, 2009
    Someone has already stared this here: http://www.labnol.org/software/tutorials/install-clip-to-onenote-firefox-extension-send-web-pages/2729/ If you want to do a different addin, the API documentation starts here: http://msdn.microsoft.com/en-us/ms788684.aspx.  There is also a schema reference here: http://www.microsoft.com/downloads/details.aspx?FamilyId=15805380-F2C0-4B80-9AD1-2CB0C300AEF9&displaylang=en and my blog has code for just about all the powertoys I've posted. I don't know about the FF side of things.  mozilla.org would be where I started looking. Be sure to let everyone know how it turns out, John

  • Anonymous
    May 02, 2009
    There have been several additions and versions - Would someone demonstrate the cumulative version,

  • with possibility to select where to send,
  • which would work even when onenote is not open,
  • etc, so that those who are not into programming could just copy it into a new script and benefit from the cumulative wisdom of those contributions? That would be very useful! Alceste
  • Anonymous
    May 26, 2009
    I concur w/ Alceste--an amalgamated update would be great!  Thanks much!

  • Anonymous
    October 24, 2009
    The comment has been removed