Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
swdev:autohotkey:examples [2018/02/13 15:28] smayr [Messages or Dialogs] |
swdev:autohotkey:examples [2018/02/13 17:37] (current) smayr [Messages or Dialogs] |
||
---|---|---|---|
Line 34: | Line 34: | ||
<code autoit> | <code autoit> | ||
; Click method: | ; Click method: | ||
- | Click 310, 65 | + | Click 310, 65 |
; MouseClick method: | ; MouseClick method: | ||
Line 80: | Line 80: | ||
Send a message with '' | Send a message with '' | ||
<code autoit> | <code autoit> | ||
+ | ; Format: | ||
+ | ; SplashTextOn [, Width, Height, Title, Text] | ||
SplashTextOn, | SplashTextOn, | ||
Sleep, 2000 | Sleep, 2000 | ||
Line 93: | Line 95: | ||
Sleep, 5000 ; pause program execution for 5 secs | Sleep, 5000 ; pause program execution for 5 secs | ||
ToolTip, , 100, 15 ; clear ToolTip | ToolTip, , 100, 15 ; clear ToolTip | ||
- | < | + | </code> |
=== Run Application === | === Run Application === | ||
Line 153: | Line 154: | ||
; MouseClick, left, 90, 65 ; Menu: Edit > Copy | ; MouseClick, left, 90, 65 ; Menu: Edit > Copy | ||
| | ||
- | ; | + | ; |
- | ; ;send, {LAlt}e | + | ; ;Send, {LAlt}e |
- | ; ;send, {LAlt down}e{LAlt up} ; menu: < | + | ; ;Send, {LAlt down}e{LAlt up} ; menu: < |
- | ; ;sleep, 1000 | + | ; ;Sleep, 1000 |
- | ; ;send, e ; menu: < | + | ; ;Send, e ; menu: < |
- | ; ;sleep, 1000 | + | ; ;Sleep, 1000 |
- | ; ;send, s ; menu option: Select All | + | ; ;Send, s ; menu option: Select All |
; | ; | ||
- | ; ; SetKeyDelay, | + | ; ; SetKeyDelay, |
- | ; ;send, {ctrl down}c{ctrl up} ; Copy using send | + | ; ;Send, {ctrl down}c{ctrl up} ; Copy using send |
; ;SendInput {ctrl down}c{ctrl up} ; Copy using SendInput | ; ;SendInput {ctrl down}c{ctrl up} ; Copy using SendInput | ||
; | ; | ||
- | ; ; Display window name | ||
- | ; WinGet, OutputVar, ProcessName | ||
- | ; ;MsgBox, " | ||
- | ; ; | ||
- | ; MsgBox, %OutputVar% | ||
| | ||
| | ||
; --- Select All (using click on toolbar) --- | ; --- Select All (using click on toolbar) --- | ||
- | SetControlDelay | + | SetControlDelay, |
- | ; | + | ControlClick, |
- | ; | + | |
- | ControlClick, | + | |
- | | + | |
if ErrorLevel | if ErrorLevel | ||
- | MsgBox, The ControlClick for ToolbarWindow322 ... ' | + | |
+ | ToolTip, The ControlClick for ToolbarWindow322 ... ' | ||
} else { | } else { | ||
- | MsgBox, The ControlClick for ToolbarWindow322 ... ' | + | |
+ | ToolTip, The ControlClick for ToolbarWindow322 ... ' | ||
} | } | ||
; ;Click 310, 66 | ; ;Click 310, 66 | ||
; MouseClick, left, 310, 65 | ; MouseClick, left, 310, 65 | ||
- | | + | |
- | ;Menu, ToolbarWindow322, | + | ToolTip, , 100, 15 ; clear ToolTip |
+ | ;Menu, ToolbarWindow322, | ||
| | ||
- | ; --- Copy (using click on toolbar) --- | + | ; --- Copy to Clipboard |
emptyClipboard() | emptyClipboard() | ||
; ; | ; ; | ||
- | ; | + | ; |
; | ; | ||
- | ControlClick, | + | ControlClick, |
; ;Click 335, 15 | ; ;Click 335, 15 | ||
; MouseClick, left, 335, 15 | ; MouseClick, left, 335, 15 | ||
- | | + | |
- | ; | + | |
; ; | ; ; | ||
+ | | ||
+ | ; --- Copy to Clipboard (using Keyboard) --- | ||
+ | ; | ||
| | ||
; --- Clear Selection (using click on toolbar) --- | ; --- Clear Selection (using click on toolbar) --- | ||
- | ; | + | ; |
| | ||
- | ; --- Copy to Clipboard --- | + | ; --- Paste from Clipboard --- |
- | ; | + | |
pasteFromClipboard() | pasteFromClipboard() | ||
} else { | } else { | ||
Line 221: | Line 220: | ||
| | ||
; Display window name | ; Display window name | ||
- | WinGet, OutputVar, ProcessName | + | |
- | MsgBox, %OutputVar% | + | |
| | ||
; Call File > New (using Mouse) | ; Call File > New (using Mouse) | ||
Line 237: | Line 236: | ||
; | ; | ||
- | ; Paste data to clipboard | + | ; Empty clipboard |
; | ; | ||
- | pasteFromClipboard() | + | emptyClipboard() |
{ | { | ||
- | ;if WinExist(" | + | |
- | if WinExist(" | + | |
- | WinActivate ; use the window found above | + | |
- | MsgBox Found Notepad | + | |
- | } else { | + | |
- | Run, Notepad.exe | + | |
- | MsgBox Running Notepad | + | |
- | } | + | |
- | sleep, 500 | + | |
- | ;Send, %clipboard%. | + | |
- | ;SendInput, {ctrl down}v{ctrl up} | + | |
- | send, {ctrl down}v{ctrl up} | + | |
} | } | ||
; | ; | ||
- | ; Paste data to clipboard | + | ; Copy data to clipboard |
; | ; | ||
copyToClipboard() | copyToClipboard() | ||
Line 262: | Line 250: | ||
emptyClipboard() | emptyClipboard() | ||
;Send, ^c | ;Send, ^c | ||
- | | + | |
ClipWait, 2 | ClipWait, 2 | ||
if ErrorLevel { | if ErrorLevel { | ||
Line 272: | Line 260: | ||
; | ; | ||
- | ; Empty clipboard | + | ; Paste data from clipboard |
; | ; | ||
- | emptyClipboard() | + | pasteFromClipboard() |
{ | { | ||
- | | + | ;if WinExist(" |
+ | if WinExist(" | ||
+ | WinActivate ; use the window found above | ||
+ | MsgBox Found Notepad | ||
+ | } else { | ||
+ | Run, Notepad.exe | ||
+ | MsgBox Running Notepad | ||
+ | } | ||
+ | Sleep, 500 | ||
+ | ;Send, %clipboard%. | ||
+ | ;SendInput, {ctrl down}v{ctrl up} | ||
+ | Send, {ctrl down}v{ctrl up} | ||
} | } | ||
Line 288: | Line 287: | ||
;MsgBox The color at the current cursor position is %color%. | ;MsgBox The color at the current cursor position is %color%. | ||
MsgBox The current mouse cursor position is X%MouseX% Y%MouseY%. | MsgBox The current mouse cursor position is X%MouseX% Y%MouseY%. | ||
- | } | + | } |
</ | </ |