 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Jeebu
Joined: 20 Aug 2009 Posts: 2
|
Posted: Thu Aug 20, 2009 9:28 pm Post subject: MS OneNote hyperlink tricks |
|
|
Hi, just started using AHK, and have written my first little script for MS OneNote but am having trouble with the second. I'm pretty lost with this stuff, to be honest.
I find that OneNote has pretty weak hyperlinking commands, so I want to make a couple of tweaks.
First, I wanted to be able to quickly link two pages to each other. This little script copies the hyperlink to the current page, inserts that hyperlink to the previous page (at wherever the insertion point was left) and then inserts a hyperlink to that second page back on the first page where you started. IOW, it creates mutually linking pages.
| Code: | #c::
Send !ehg!{Left}^v^t!ehg!{Right}^v
;copies hyperlink to current page
;back to last page
;paste
;move to page header
;copies hyperlink to current page
;forward to earlier page
;paste
return |
OK, so it's a pretty simple code. How could it be improved upon? I don't even know how to make it work exclusively in OneNote.
But here's my question. I'd like to make another script to copy text formatted with a hyperlink to its current section. IE, the pasted item contains a link to its original position (similar to what happens when you paste a clip from a web site, in fact).
I was going to do a simple macro of keyboard commands like the previous script. Something like the following commands, which I could use when I have something selected: "Copy hyperlink to current section" > "insert hyperlink" > "paste" > "enter" > "copy" > "AppsKey" > "remove hyperlink".
Again, not very sophisticated, I'm sure, but I don't see why it wouldn't work.
The only problem is that after closing the hyperlink dialog box, the text that was originally selected is no longer selected, (ie, between "enter" and "copy" in my little sequence). So, I'm thinking I need AHK to remember what I had originally selected, and then reselect it before going on to the next set of commands.
So how would i do that? Or am I going about this all wrong? |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1317 Location: USA
|
Posted: Fri Aug 21, 2009 2:33 am Post subject: Re: MS OneNote hyperlink tricks |
|
|
| Jeebu wrote: | | I don't even know how to make it work exclusively in OneNote. |
the ahk_class for my version of onenote (2003) is Framework::CFrame
so you would do
| Code: | #IfWinActive ahk_class Framework::CFrame
; ...
; your code
; ...
#IfWinActive
|
| Jeebu wrote: | | "Copy hyperlink to current section" > "insert hyperlink" > "paste" > "enter" > "copy" > "AppsKey" > "remove hyperlink" |
what are the menu options / key commands to do this?
also, what version one note are you using? _________________
ʞɔпɟ əɥʇ ʇɐɥʍ |
|
| Back to top |
|
 |
Jeebu
Joined: 20 Aug 2009 Posts: 2
|
Posted: Fri Aug 21, 2009 8:52 pm Post subject: Re: MS OneNote hyperlink tricks |
|
|
thanks for the reply. I'll try what you did with the code.
As for the commands you asked about:
| Code: |
!eha ;Copy hyperlink to current section
^k ;insert hyperlink
^v ;paste
{enter} ;enter
^c ;copy
{AppsKey} ;context menut
r ;remove hyperlink |
That was the sequence of commands that I envisioned.
I'm using OneNote 2007 SP2, so it might be different on yours. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|