Menu
  • HOME
  • TAGS

Get the value of an input field in IE using AHK

autohotkey

Here is a simple working example ( win7 v1.1.19.01 IE11 ) FileSelectFile, path wb := ComObjCreate("InternetExplorer.Application") wb.visible := true wb.navigate(path) while wb.readyState!=4 || wb.document.readyState != "complete" || wb.busy continue return f6:: msgbox % wb.document.all["area2"].value return I have sometimes also had problems with IEGet() and IE9+ but here is the function...

Autohotkey: copy paste

email,outlook,autohotkey,copy-paste

(REFERRING TO YOUR INITIAL QUESTION) Note: You don't need to empty the clipboard before refilling it. Simply append the ; to each result and store it in a global variable. Once you want to release the variable's contents, press Win+V. all_mails := "Run, mailto: " #x:: ; store e-mail ;Copy...

How to resize a modern windows app with autohotkey

windows-8,resize,autohotkey

After trying out the tips in the comments, I debugged the error until I realize that Left was not being interpreted as the Left Arrow (even though it says so in the help of AutoHotkey). Replacing Left with NumpadLeft solved it. No UIAccess needed in this case. Sample: RunWait "D:\Temp\TranslationSource.pdf"...

Use of application name with space(s) with WinExist

autohotkey

WinExist is a function and function parameters are expressions... In expressions you need to use double quotes " around strings and you don't need % around variables you also need to have a space before the semicolon to use comments #SingleInstance force #Persistent settimer, idleCheck, 1000 ; check every second...

Window transparency changing affecting active windows

autohotkey

One way is to use the winexist() function with the A option as the wintittle parameter, that will give you the ID of the active window so that you can use that. Something like this NumpadEnter:: hWnd := WinExist("A") Trans:=255 Loop { WinSet, Transparent, %Trans%, Ahk_id %hWnd% Sleep, 20 Trans-=1...

How to update AutoHotkey GUI Text control?

user-interface,autohotkey

Here is working code: kills=0 #n:: Gui,Add,Text,vStatus, starting the killing Gui,Show,w250 h375, Glorks counter Loop { IfWinNotExist, Glorks counter { Gui, Destroy return } GuiControl,,Status, killed %kills% Glorks! kills+=1 Sleep,3000 } return Your mistakes: You should use Status instead of vStatus in GuiControl command. When you close GUI, you are...

How to make a key toggle itself down and up with AutoHotKey

autohotkey

Have your code trigger and toggle only on key release: $Tab Up:: if (toggle:=!toggle) { Send, {Tab Down} } else { Send, {Tab Up} } Return See UP keyword here: http://ahkscript.org/docs/Hotkeys.htm#Symbols...

Keyboard Keys to Paste Text with AutoHotKey

text,keyboard,autohotkey,paste

You can do this just fine with AHK. Use a continuation section (check out Method #2) section and SendInput. myText = (LTrim Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eleifend ultrices metus, a auctor tellus vulputate eu. Praesent sed quam vitae tortor venenatis tempor. Duis a pretium eros....

AutoHotkey script for toggling Sublime Text 3 sidebar or is there a native ST setting?

sublimetext,sublimetext3,autohotkey

You can change that within Sublime. Go to Preferences -> Key Bindings - User and paste this: [ { "keys": ["f10"], "command": "toggle_side_bar" } ] If you already have a bunch of custom key bindings, omit the square brackets. { "keys": ["f10"], "command": "toggle_side_bar" } ...

Autohotkey flickering GUI

user-interface,autohotkey

Use GuiControl to update control values without redrawing the gui window #SingleInstance #Persistent Gui, Add, Text, x2 y30 w120 h20 , IPv4 Addresses Gui, Add, Edit, x2 y50 w120 h20 vMyEdit1 ReadOnly, %A_IPAddress1% Gui, Add, Edit, x2 y70 w120 h20 vMyEdit2 ReadOnly, %A_IPAddress2% Gui, Add, Edit, x2 y90 w120 h20...

AutoHotKey Internet Explorer Object Retreive Span tag Text

html,internet-explorer,autohotkey

planID := wb.document.getElementsByClassname("textOnMed")[0].innerText ...

AutoHotKey macro scripting to open Outlook and create appointment

macros,autohotkey

It is not particularly robust or elegant but the code below works well on my machine. Have outlook running open to inbox without other outlook windows present for testing. Pressing 'window + u' will first look for an approximate window match (you can also use ahk_class) and send keystrokes to...

Snap mouse cursor to center of screen

autohotkey

Try this: #Persistent ;//keeps script running CoordMode, Mouse, Screen Return ;//stops auto execution F4:: ;//your code x := (A_ScreenWidth / 2) y := (A_ScreenHeight / 2) mousemove, x, y return Without #Persistent, script would close after executing all the lines of code. Autohotkey executes every line of code until the...

AutoHotKey Script Continually Opening Program

batch-file,autohotkey

I don't see a reason for that to happen. What program do you try to open? What happens if you run an empty script with just that line in it? Run, %A_WinDir%\system32\notepad.exe You only need the second parameter (working directory), if your script is not in the same folder as...

AutoHotKey code to receive ctrl+x while pressing ctrl+c twice

autohotkey

Assuming we are talking about Ctrl+C, not V, and assuming you want to keep the original Ctrl+C function but also use it for Ctrl+X when pressing twice in a short time: #persistent Transform, cC, Chr, 3 ; store the value of ctrlC into cC. hotkey, $^c, ctrlC, ON ; this...

AutoHotKey JavaScript Link

javascript,html,autohotkey

More then one way get to an element without a ID or Name, but one of the easy ones are to loop over the elements on the page until you get to the one you need. Example Function: LoopElements(Elements, String, attribute="title") { try Loop % Elements.Length ; check each element...

Why does this operation break when turned into a function (AutoHotKey/AHK)

function,com,macros,ms-office,autohotkey

You're calling return before the function can finish. This causes the script to stop processing that function and return to the caller. ReplaceAndLink(FindText, ReplaceWith) { ; Word Constants vbTrue := -1 wdReplaceNone := 0 wdFindContinue := 1 return <---------- HERE try oWord := ComObjActive("Word.Application") catch return Try removing that and...

Why does AutoHotkey respond with a “System cannot find the file” error?

windows,autohotkey

That path gets redirected to C:\Windows\SysWOW64 for 32-bit programs. Try changing the path in your script to "C:\Windows\SysNative\msg.exe" Or better yet, don't put non-system files in directories owned by the OS....

Switching between windows

internet-explorer,autohotkey

Fix It! Adding sleep, 2000 before WinActivate, ahk_class IEFrame save the world...

Extracting values from text file using autohotkey

file,extract,autohotkey,readline,substr

You can use FileRead and RegExMatch var:=" ( Date: 2014-12-02 12:06:47 Study: G585.010.411 Image: 6.24 Tlbar: 2.60 Notes: 0.74 )" ;~ FileRead, var, C:\file.txt pos:=1 while pos := RegExMatch(var, "\s?(.*?):(.*?)(\v|\z)", m, pos+StrLen(m)) %m1% := m2 msgbox % "Date holds " date . "`nStudy holds " Study . "`nImage holds "...

ControlSend Using the Control Text, Rather than Window Text in AHK

autohotkey

F1:: ControlClick, Cancel, ahk_class TROListForm or F1:: Loop { Sleep, 100 IfWinExist, ahk_class TROListForm ControlSend, TmtBitBtn2, {Enter} ahk_class TROListForm ; or ; ControlClick, Cancel, ahk_class TROListForm } return ...

AutoHotKey: How to disable a Skype hotkey and make your keyboard behave normally

autohotkey,skype

Please note that this #IfWinActive, ... !^r:: #If is no valid deactivation of a hotkey: attach the return keyword, so it is !^r::return. Otherwise, after pressing alt ctrl r, any code further down below will also be executed. Also, if you only want to remap the AltGr hotkey, you should...

How to wrap currently selected text in ``

autohotkey

Your approach is pretty good already. Try this: $`:: clp_tmp := ClipboardAll send ^c currently_selected := Clipboard stringReplace, currently_selected, currently_selected, `r,, All Clipboard := clp_tmp sendraw ``%A_Space% sendraw %currently_selected% sendraw ``%A_Space% return $ is needed because otherwise, sendraw `` would re-trigger this hotkey. The built-in variable clipboard / clipboardAll contains...

Correct my AutoHotKey Loop Script

scripting,autohotkey

Try this: $1:: freq:=16000 Loop { Send, 1 Sleep %freq% Send, 2 Sleep %freq% Send, 3 Sleep %freq% Send, 4 } return ...

AutoHotkey (AHK): GetKeyState not recognizing keypress made by ControlSend

state,autohotkey

I agree with blackholyman "GetKeyState will not work for controlsend as GetKeyState Gets the global system state of the key but controlsend only sets the state locally i.e the key state is only set for one control or window." But if you need "ControlSend for certain window functions, such as...

Autohotkey check for Ctrl pressed error

keypress,autohotkey,blocking

Figured it out. LControl:: ;if ctrl is pressed Set:=4 ;enter first selection group SendEvent {Ctrl Down} ;don't interrupt normal hotkeys Return LControl Up:: ;if ctrl is released Set:=0 ;"unbind" q/w/e hotkeys SendEvent {Ctrl Up} ;and inform the system Return #If (Set=4) { ^q:: Set:=1 ^w:: Set:=2 ^e:: Set:=3 } Sending...

How do you display a progress bar within a gui

autohotkey

Pretty simple: Gui, Add, Progress, w200 h20 -Smooth vMyProgress, 0 Gui,Add,Text,vStatus, See status bar for dowload progress Gui,Show,w250 h375 GoSub, blah Return blah: GuiControl,, MyProgress, 50 Return ...

Autohotkey and Cisco Jabber - Click to call

clipboard,autohotkey

Give this a shot: ~$^D:: Send {ctrl down}{c down}{ctrl up}{c up} ClipWait, clipboard = %clipboard% StringReplace, tel, clipboard, %A_SPACE%, , All tel := RegExReplace(tel, "\(.*\)", "") Run, tel:%tel% Return ...

How to concatenate a number and a textstring in auto hotkey

autohotkey

You used NewText += % ColorNumber thisChar + is used for adding up numbers. But the operator for concatenating strings is . in AutoHotkey. Note that this all varies from language to language. So it should be: NewText .= ColorNumber . thisChar which is the same as NewText := NewText...

click specific area inside pixelsearch?

autohotkey

You could simply alter the click coordinates, couldn't you? PixelSearch, X, Y, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, 0x00FF00, 0, fast if(ErrorLevel=0) { newX := X + 50 newY := Y + 50 MouseClick, left, %newX%, %newY% } Another suggestion: use ImageSearch instead of PixelSearch...

Autohotkey: Scrape text from window (LOTRO)

automation,autohotkey,mmo,online-game

Games have non conventional GUIs and you can't just get there controls and use them. For getting information from screen for nonconventional GUIs you can use following commands: ImageSearch, PixelGetColor, PixelSearch. You can also try to get information from registry (maybe information that you need is stored in registry) with...

{LShift}{RShift}:: to change keyboard layout

autohotkey

LShift & RShift:: Run notepad Return ...

is it possible to combine pixelsearch and pixelgetcolor

autohotkey

You are missing a very essential part of programming in all non-lowlevel-programming languages: Braces. (In AutoIt, I think you don't use braces but if and endif / wends etc. instead which is basically the same It is important to understand that the compiler in AutoHotkey does not care about the...

Using to letter activation of autohotkey

autohotkey

"to" = two? ctrl+n+o+i opens chrome #if getKeyState("n") & getKeyState("o") ^i::run chrome.exe #if ...

How can I make A_Index start from a value greater than 1?

autohotkey

One way is to store the value first then use it Loop, 1000 { MyIndex := A_Index+970 Send, analyze %MyIndex% {Enter} } Hope it helps...

AutoHotkey script triggered by Shift + g + AppsKey

autohotkey

You're trying to make a three-key combination, which isn't supported by this short syntax. Making such a hotkey requires an additional if-statement. You need to choose two keys that will enter the function, let's say Apps+g, and then use GetKeyState for the third key. So, the solution is as follows:...

Autohotkey ClipboardAll in function does not work

copy,clipboard,autohotkey,paste

Seems that AutoHotkey's arrays cannot store the contents of clipboardAll. Someone should report this... Instead, if you use pseudo arrays, it'll work. So you can either go for this global clips0,clips1,clips2,clips3,clips4 ; ... copy(index){ Send ^c clips%index% := ClipboardAll } paste(index){ Clipboard := clips%index% Send ^v } ^q:: copy(0) !q::...

AutoHotKey Adding to Array within function call

arrays,autohotkey

Usually, global/local declarations are placed right below the method header, not somewhere in some subsequent code block. After all, these declarations apply only to the entire function. You have to distinguish between simple loop counter variables and variables holding the actual size of the array. In your code, CaseNumberArrayCount describes...

How to make eclipse allow autohotkey shortcuts to work?

eclipse,autohotkey

Found the solution: I was running eclipse as administrator. Compiling the script to a standalone executable and running that as an administrator solved the issue....

Running a batch from an autohotkey script that deletes itself and the script

batch-file,autohotkey

You can try with del "%~f0" & exit ...

How to remove button border style?

button,styles,autohotkey

JoeDF has a nice example, but I didn't want to add such a big library (it does waaay more than I needed. So, I just used a picture control. gui, add, picture h16 w16 vMyButton gMyProcedure, icon0, mydll And then I wrote up a teeny library called Mousey that will...

Auothotkey: Remove string, placement string in subject box

internet-explorer,autohotkey

Instead of: LSN := pTable.rows[9].GetElementsByTagName("TD")[1].outerHTML Try: LSN := pTable.rows[9].GetElementsByTagName("TD")[1].innerText Here's an explanation. If that doesn't work you can try StringReplace: StringReplace, LSN, LSN, <TD>,, ALL As far as your code that is not sending your text to the End of you document try ControlFocus, ControlClick, and Sleep ;Set focus on...

Loop Error in AutoHotkey [closed]

autohotkey

Assuming you want to start it by Ctrl+P, you simply have to put the loop inside the hotkey execution body: ^p:: loop { Send, {Space} Sleep, 50 } return Note: It's good programming style to end your hotkeys with return, but please know that this return will never be reached!...

Problems with control flow with subroutines and functions

autohotkey

First of all, all instructionis after any return keyword will not be executed. ^!r::Reload is the short form for ^!r:: reload return and therefore, the inireads will never be executed. Secondly, you are executing the gui, add, ... commands more than once. You might want to put them only into...

How to insert a button into a web page using IE via AHK

autohotkey

Never mind - figured it out. It's more of an IE DOM question than an AHK question. This is how it's done: wb := IEGet("Page1") inp := wb.document.createElement("input") typ := wb.document.createAttribute("type") typ.value := "button" val := wb.document.createAttribute("value") val.value := "Click Me!" inp.setAttributeNode(typ) inp.setAttributeNode(val) wb.document.all.external.appendChild(inp) ...

Autohotkey script doesn't work for FreeCommander

autohotkey

The ahk_class of the FreeCommander doesn't contain "FreeCommander" anywhere inside it. Use Window Spy to find this out. ; set Matching Mode to use Regular Expression SetTitleMatchMode, RegEx ;#IfWinActive ahk_class FM ; F8::SendInput {NumpadAdd} #IfWinActive .*FreeCommander ; applies to the title F8::SendInput {NumpadAdd} #IfWinActive By the way, I recommend using...

Script doesn't work when I try to launch it

autohotkey

Does this work? $F1:: Loop, 2 { Click Sleep 5000 Send {1} Sleep 46000 } return Esc::ExitApp ...

Hotkey for next song in Spotify

autohotkey,spotify

I managed to make it work using multimedia keycodes. Here's my script: ; "CTRL + LEFT" for previous ^Left::Media_Prev ; "CTRL + RIGHT" for next ^Right::Media_Next ; "CTRL + SPACE" for pause ^Space::Media_Play_Pause It's working like a charm now....

run command in autohotkeys n number of time

windows,scripting,autohotkey

::t:: input, count, I T5, {Enter} if count is Integer { loop, %count% send test } return After pressing t, Tab, this will give you 5 seconds to type any number (accept it by pressing Enter, remove digits by pressing Backspace) and immediately send test as much times. See also:...

How to not send hotkey text to open editor

autohotkey

You can't do it with a Hotstring but you would have have to use a Hotkey and check for a double key press. A regular key like x might not be the most useful as it will most likely always get in the way of your regular typing as you...

Unable to emulate mouse buttons with combination keys

autohotkey

What you are trying to achieve is remapping two keys to one. AutoHotkey documentation says: Although a pair of keys cannot be directly remapped to single key (e.g. it's invalid to write a & c::b), this effect can be achieved by explicitly adding the up and down hotkeys [link] So,...

Creating Vim like functionality with AutoHotKey (AHK)

windows,vim,autohotkey

Create context-sensitive hotkeys with #If: #If GetKeyState("CapsLock", "T")=1 ; The following hotkeys will only be effective if GetKeyState("CapsLock", "T")=1 j::Send,{Left} l::Send,{Right} i::Send,{Up} k::Send,{Down} #If ; end of #If ...

Simplify code when button label is similar

button,optimization,autohotkey

Shorter when using an array #NoEnv #SingleInstance Force #Persistent #Warn Array := {"FileOpen1":"MyEdit4","FileOpen2":"MyEdit5","FileOpen3":"MyEdit6"} Gui, Add, Button, x212 y10 w120 h30 vFileOpen1 gFileOpen, Browse Gui, Add, Button, x212 y50 w120 h30 vFileOpen2 gFileOpen, Browse Gui, Add, Button, x212 y100 w120 h30 vFileOpen3 gFileOpen, Browse Gui, Add, Edit , x12 y10 w180...

How To Detect Ctrl+V In AHK?

autohotkey

~^v::lastPaste := A_TickCount ;stores counter when ctrl+v is pressed Xbutton1:: If A_TickCount - lastPaste < 2000 ;checks if 2 seconds gone after ctrl+v was clicked { Send, {Enter} ;sends enter return } else { Send, ^t ;sends ctrl+t return } ...

Autohotkey Regex Lookbehind Assertion

regex,autohotkey

I got it working with this: ;Fetch the uncommented inclusion line regexmatch(searchthis, "mi)(?<=(?<!%)\\includescore).*?{(.*?)}", matchfile) ;Now pull out the bracketed item regexmatch(matchinclusion, "i)(?:\[.*\])", includeparam) ;get the parameter ;now pull out the filename with/without the extension regexmatch(matchinclusion, "i)(?<={)(.*)(?=})", inclusionfile) ;get the tex name It matches on all counts, and excludes the line...

Array in Autohotkey?

arrays,list,keyboard-shortcuts,autohotkey,hotkeys

Example ; List of keys to bind keys := "wasd" ; bind the keys to keypress_handler Loop, parse, keys hotkey, ~%A_Loopfield%, keypress_handler ; our key handler keypress_handler: StringReplace, ThisKeyLabel, A_ThisHotkey, $ While GetKeyState(ThisKeyLabel,"P") { Random, r, 50, 250 sleep r Send % ThisKeyLabel } Return ...

Autohotkey F4 script does not work on Excel 2013

excel,autohotkey,excel-2013

I've figured out a way here, thanks for the comments. By using the $ operator, we can then use the Send method, which forces the active application to override its default keys and receive the corresponding keystroke. Here's the workaround $#4:: #IfWinActive ahk_class XLMAIN Send {F4} return #IfWinActive ...

SendInput won't work at high speed

autohotkey

So this is still an issue for you? Looks to me like an AutoHotkey bug most likely, or wrongly sent js because your RAM can't handle the heavy programs well enough. Things I can think of that you could try: buy a better computer. use setBatchLines, 1ms, making your script...

Possible to save a file in AutoHotKey script?

copy,autohotkey

I havent tested (1) and (2), but here are three different approaches: modifying AutoHotkeySC.bin with a third-party tool like ressource hacker building a .dll which you then might access via ahk pack the complete file into your script and start its creation upon function calling. I saved this guy's V2.3...

GuiControl works with one variable but not another

autohotkey

MJs of the AHKscript.org forums answered my question. GuiControl wasn't targeting the right control because I created the window with Gui, New. Removing Gui, New fixed the problem.

Why are dead keys not working with some letters in AutoHotkey?

keyboard-shortcuts,autohotkey,globalization,keyboard-hook,dead-key

In my particular case, the letters not working are: e y s d k n Try reorganizing these letters. I find this very hillarious indeed. Please insert any expression of laughter yourself, for it would not be welcomed on stackoverflow if I did. You forgot to include your %'s....

WinWaitActive function isn't behaving as expected

loops,autohotkey

^ is the Ctrl modifier, you want to use !{Enter}. Try this: #SingleInstance, Force Loop { WinWaitActive, MyProgram Send, !{Enter} WinWaitNotActive, MyProgram } ...

Solution to a “dynamic”/“unstable” ahk_class name?

autohotkey

You definitely are on the right track trying to incorporate ahk_exe. GroupAdd (and every other command receiving a WinTitle parameter at that) is compatible with ahk_exe in AHK_L; this sample code works perfectly on my machine: GroupAdd, notepad, ahk_exe notepad.exe Run, notepad.exe WinWaitActive, ahk_group notepad Sleep, 1000 WinClose, ahk_group notepad...

How can others connect on my AHKsocket winsock server? External IP?

connection,ip,autohotkey,tcp-ip,winsock2

Did you forward the appropriate ports in your router/firewall? The IP should be correct. This was the solution, I did something wrong in my router...

AUTOHOTKEY: RegExMatch() a series of numbers and letters

regex,match,autohotkey

You had to many ( ) This is the correct implementation: test := RegExMatch("1234AB123","[0-9]{4,4}([A-Z]{2})[0-9]{1,3}") Edit: So what I noticed is you want this pattern to match, but you aren't really telling it much. Here's what I was able to come up with that matches what you asked for, it's probably...

Global keyboard function in Autohotkey?

windows,function,keyboard,global,autohotkey

I am not aware of a way to catch all keys. But you can simplify your code by combining hotkeys this way: $a:: $b:: $c:: ; and so on... $z:: RandomSendCurrentKey() ; all the above hotkeys will call RandomSendCurrentKey() return ; 'return' is needed to prevent further execution RandomSendCurrentKey() {...

Newest Spotify update: Autohotkeys script broke

autohotkey,spotify

See this question: Hotkey for next song in Spotify - includes a statement from a Spotify developer, as well as a statement that it will be fixed in the upcoming version, as well as a workaround for the moment: ^Left::Media_Prev ...

Shortcuts key replacemento with AutoHotkey

autohotkey

You don't need the { } around the hotkey body. Hotkeys simply start with :: and end with return. Braces are only needed in functions afaik. send {LControl down}{tab}{LControl up} could be expressed easier by send ^{tab} which is Ctrl+Tab. The tab-switch in VS also works with right RCtrl. In...

Autohotkey will prematurely end loop during execution

sql-server,sql-server-2012,autohotkey

The reason it ends prematurely is probably due to the copy-command not having enough time to properly update the clipboard before you go to work on it. The best way to handle this is to clear the clipboard before copying anything, and relying on ClipWait to tell us when something...

Autohotkey - ControlClick inside window

autohotkey

too much to comment on, I'll make it an answer instead: a::Left s::Down d::Right w::Up Loop{ ... Key remappings (s::Down) bring a return with them implicitly. Same way as a hotkey like s::msgbox, hi is only the short form for s:: msgbox, hi return , key remappings are only a...

AutoHotkey's for the arrow keys

autohotkey

Hello and welcome to AutoHotkey, you might want to have a look at the basic introduction to the heart of AHK, Hotkeys: https://www.autohotkey.com/docs/Hotkeys.htm Configuring hotkeys which do nothing but send another key is fairly simple. For example, alt + spacebar for the up key could be translated into !Space:: send...

AHK key combination issue

autohotkey,transliteration

You could either try to build up something yourself using Input. Or, more comfortably, use Polythene's dynamic regEx-Hotstring library: #persistent #include hotstrings.ahk hotstrings("s([^h])", "c%$1%") ; s followed by any non-h-character return :*:h::x :*:sh::? ...

Replace a middle string in .bat file using AutoHotKey without deleting file

autohotkey

Fileappend will always append to the end of a file. Why do you want to prevent a temporary deletion of your batch file? Typically, in ahk, you'd do it like this.. batFile = C:\standalone.bat output := "" Loop, read, %batFile% { Line = %A_LoopReadLine% IfInString, Line, Xmx1426M { StringReplace, Line,...

Why does this A_TickCount call in AutoHotKey yield incorrect results?

function,time,autohotkey

Can't say for sure whats happening but seems to come from the keyboard drivers auto-repeat. This will show you how it keeps recalling A_tickCount i:: iDown := A_TickCount tooltip %iDown% return i up::MsgBox, % "down at " iDown ", up at " A_TickCount ", down for " A_TickCount - iDown...

Toggle loop when a key is pressed?

loops,toggle,autohotkey

Or this: Tab:: toggle := !toggle #If toggle ~LButton:: while GetKeyState("LButton") { Send {1} Random, r, 100, 400 sleep r } return #If ...

Insert long text faster

text,autohotkey

Maybe this: ::li:: ClipSaved := ClipboardAll ; save clipboard clipboard = Lorem ipsum dolor ... ; ClipWait Send, ^v clipboard := ClipSaved ; restore original clipboard return ...

Break out of mouse movement according to user behavior

autohotkey

Maybe sth like this: (reedited 21.01.2015) F1:: Loop { MouseGetPos, X0, Y0 MouseMove, 200, 100, 50, R GoSub, BreakLoop MouseMove, -200, -100, 50, R GoSub, BreakLoop } return BreakLoop: Loop, 1000 { Sleep, 15 MouseGetPos, X1, Y1 If (X1-X0>200 || X0-X1>200 || Y1-Y0>100 || Y0-Y1>100) exit } return Esc::ExitApp ...

how to make a “`” symbol in a string in ahk?

string,autohotkey

Escape your symbol (backtick) by prefixing it with a backtick (which happens to be the default escape character): string := " %%i IN (``" Refer to #EscapeChar for details....

Autohotkey get user domain variable

variables,dns,autohotkey,var

Found using google in less than a min.. http://www.autohotkey.com/board/topic/77940-detect-current-windows-domain/...

Want AutoIt3 HotKeySet to Emulate AutoHotKey Application Filtering

autohotkey,autoit

In case the GUI you are trying to control is your own GUI: If you want hotkeys that are not system wide, you should use GUISetAccelerators ( accelerators [, winhandle] ) GUISetAccelerators Sets the accelerator table to be used in a GUI window. Parameters accelerators A 2 dimensional array holding...

Is there built-in command or macro to open Window Spy?

autohotkey

I am not aware of any built-in commands, but you can run Window Spy by: Run, "c:\Program Files\AutoHotkey\AU3_Spy.exe" Replace c:\Program Files\AutoHotkey\AU3_Spy.exe by your path to AU3_Spy.exe Also, always use AutoHotkey and its documenatation from http://ahkscript.org/ (current uptodate version, new official website)! AutoHotkey and its documentation from autohotkey.com is outdated and...

Autohotkey ctrl + Key == Arrow

autohotkey

Using AutoHotkey v1.1+ from http://ahkscript.org This works ^i::send {Up} ^k::send {Down} ^j::send {Left} ^l::send {Right} Hope it helps...

I can't find out why my Autohotkey script sometimes works and sometimes not

user-interface,autohotkey

OK, in mean time I found out, but till now hadn't time to add this here (and kinda forgot). The thing is: If the menu gets redrawn every second it will only cause an action until it gets redrawn. So if you have pulled it up and the redraw happens...

AutoHotKey “Send” Delay?

autohotkey,windows-7-x64

SetKeyDelay is what you need. Note: SetKeyDelay is not obeyed by SendInput; there is no delay between keystrokes in that mode. This same is true for Send when SendMode Input is in effect....

How to toggle between two Autohotkey configurations

autohotkey

First of all, the message-boxes you have inside the #If statements will not behave as expected. The first one, on line 7 will always go off, telling you it's Setting Mac settings. Your hotkeys however, will be setup properly. I think this is due to the auto-exec section reaching all...

Toggle disabling mouse click

autohotkey

F12::BlockClick := not BlockClick #If BlockClick { LButton::return } Also, always use AutoHotkey and its documenatation from http://ahkscript.org/ (current uptodate version, new official website)! AutoHotkey and its documentation from autohotkey.com is outdated and you may have some problems using them!...

AutoHotKey Source Code Line Break

autohotkey

There is a Splitting a Long Line into a Series of Shorter Ones section in the documentation: Long lines can be divided up into a collection of smaller ones to improve readability and maintainability. This does not reduce the script's execution speed because such lines are merged in memory the...

autohotkey copy link text on click to clipboard

autohotkey

First: Install this Chrome extension: https://chrome.google.com/webstore/detail/copy-link-address/kdejdkdjdoabfihpcjmgjebcpfbhepmh?hl=en Second: a. If you want to copy to the clipboard link adress that is under your mouse cursor and after open that link to another window use this code: ^LButton:: Send, ^c Send, {Ctrl Down} Click Send, {Ctrl Up} return b. If you want...

hotkeys does not work when send is in loop

autohotkey

It's because your loop is blocking any other execution. Unless that loop is the only thing in your script, you generally want to avoid using loops and use timers instead. Timers don't block further execution but act more like their own thread. Here's an example using a timer: slashTimerActive :=...

How to detect what Ribbon is currently active in a Microsoft Office application?

ms-office,autohotkey,ribbon,onenote

The ribbon is not a normal control and can be hard to work with from plain VBA or ahks built-in COM but you can use Microsoft's Active Accessibility API You Can use the Acc lib so you don't need to know all the dll calls But you still need to...