Copy and Paste to OneNote (AutoHotKey script) http://it.knightnet.org.uk/2009/04/copy-and-paste-to-onenote-autohotkey-script.html
Posted on
2009-04-01 (Wed)
by Julian Knight
Updated on 2009-08-21 (Fri)
After yesterdays OneNote
Another annoyance of OneNote is it’s lack of control over pasting information from the clipboard. I’ve raised a suggestion with MS to improve this; you can see my comment in the newsgroup.
To ease things a little if you need to copy and paste lots of stuff to OneNote, here is an AutoHotKey script to help. You need to assign this to a hot-key and have OneNote open in the background. Select something and press the hot-key and it will be pasted (using the current default paste option as this cannot be controlled) into the current note in OneNote.
?
; AutoHotKey Script to copy pre-selected stuff from the currently active window
; to the currently open note in OneNote
;
; Usage: #include in your main AutoHotKey.ahk assigned to a hot key
; Limitations:
; 1) OneNote must be open - maybe change this in the future so that content goes to a new unfiled note
; 2) Doesn't swap back to original application
;
; Author: Julian Knight, http://www.knightnet.org.uk/contact.htm
; Version: 2009-04-01 v1.0
; We need a partial title match but we will also reset to previous setting
oldTitleMatchMode := A_TitleMatchMode
SetTitleMatchMode, 2
; Settings
winTitlePart := " - Microsoft Office OneNote" ; Partial title of ON windows
; Copy currently selected stuff
SendPlay, ^c ; Use sendplay to avoid unexpected interactions with Win key
; If OneNote is not started, give up
IfWinExist, %winTitlePart%
{
; Save the currently active window title
WinGetTitle, actWin, A
; 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
SendPlay, ^v`r ; Use sendplay to avoid unexpected interactions with Win key
; Switch window back to previously active
WinActivate, %actWin%
}
else
MsgBox, Could not activate OneNote window.
} else
MsgBox, Can't find ON [%winTitlePart%]
SetTitleMatchMode, %oldTitleMatchMode%
return
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
; AutoHotKey Script to copy pre-selected stuff from the currently active window
; to the currently open note in OneNote
;
; Usage: #include in your main AutoHotKey.ahk assigned to a hot key
; Limitations:
; 1) OneNote must be open - maybe change this in the future so that content goes to a new unfiled note
; 2) Doesn't swap back to original application
;
; Author: Julian Knight, http://www.knightnet.org.uk/contact.htm
; Version: 2009-04-01 v1.0
; We need a partial title match but we will also reset to previous setting
oldTitleMatchMode := A_TitleMatchMode
SetTitleMatchMode, 2
; Settings
winTitlePart := " - Microsoft Office OneNote" ; Partial title of ON windows
; Copy currently selected stuff
SendPlay, ^c ; Use sendplay to avoid unexpected interactions with Win key
; If OneNote is not started, give up
IfWinExist, %winTitlePart%
{
; Save the currently active window title
WinGetTitle, actWin, A
; 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
SendPlay, ^v`r ; Use sendplay to avoid unexpected interactions with Win key
; Switch window back to previously active
WinActivate, %actWin%
}
else
MsgBox, Could not activate OneNote window.
} else
MsgBox, Can't find ON [%winTitlePart%]
SetTitleMatchMode, %oldTitleMatchMode%
return
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Technorati : AutoHotKey, Configuration, Development, Microsoft, Office, OneNote, Scripting
Diigo Tag Search : AutoHotKey, Configuration, Development, Microsoft, Office, OneNote, Scripting
Be Sociable, Share!
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
相关推荐: pytest + yaml 框架 -29.模板过滤器语法与自定义过滤器使用
前言 v1.2.6 版本支持模板过滤器语法的使用,并且可以自定义过滤器了。针对有同学提到上个接口返回一个id值,下个接口引用变量的时候需要根据这个值做一些运算,比如在引用的结果加1. jinja2 是可以支持模板过滤器语法的,本篇介绍下模板过滤器的相关使用. …