Search found 26931 matches

by mikeyww
51 minutes ago
Forum: Gaming Help (v1)
Topic: My AHK script is not working as intended: pause/unpause & autoclicker
Replies: 18
Views: 276

Re: My AHK script is not working as intended: pause/unpause & autoclicker

I did not test your script. If you would like to create a hotkey for a different context, such as #If cooling2(A_ThisHotkey) , then you would place such a directive before the first hotkey in that context. The #If directive applies to all hotkeys and hotstrings below it, until the next such directiv...
by mikeyww
58 minutes ago
Forum: Ask for Help (v1)
Topic: Translation hotkey
Replies: 4
Views: 27

Re: Translation hotkey

The "Scripts and Functions" boards contain additional working scripts of many kinds. https://www.autohotkey.com/boards/viewforum.php?f=6 https://www.autohotkey.com/boards/viewforum.php?f=83 You can have both versions, v1 and v2, installed and then run scripts of either version. I write new scripts i...
by mikeyww
Today, 06:02
Forum: Ask for Help (v2)
Topic: Menu-item hotkey does not work the very first time only
Replies: 9
Views: 105

Re: Menu-item hotkey does not work the very first time only

First, test by showing a MsgBox instead of sending text. If that works, add a short sleep before sending your text. Check KeyHistory.

Sounds like something else steals the focus somehow, or there is a UAC issue.
by mikeyww
Today, 00:08
Forum: Ask for Help (v2)
Topic: Error: Hotkeys/hotstrings are not allowed inside functions or classes.
Replies: 13
Views: 96

Re: Error: Hotkeys/hotstrings are not allowed inside functions or classes.

I'm not sure what this means: "I press up (keypress), end (keypress)". Is this a sequence? A combination? Something else? Hotkeys work individually unless you add code to handle sequencing. Naming two or more hotkeys on consecutive lines does not actually enact or detect a key sequence. Below is inf...
by mikeyww
Yesterday, 21:09
Forum: Ask for Help (v2)
Topic: Error: Hotkeys/hotstrings are not allowed inside functions or classes.
Replies: 13
Views: 96

Re: Error: Hotkeys/hotstrings are not allowed inside functions or classes.

Although you posted many scripts, nowhere in this thread have you described what your script should do. In addition, no examples are provided. A script is not a statement or description of your intent. It is merely a product of your coding. Without any statement of your goal, I cannot comment on how...
by mikeyww
Yesterday, 20:27
Forum: Ask for Help (v2)
Topic: Error: Hotkeys/hotstrings are not allowed inside functions or classes.
Replies: 13
Views: 96

Re: Error: Hotkeys/hotstrings are not allowed inside functions or classes.

The outer braces are not necessary and, I would say, are also not recommended. In this case, they do not create a specific problem, but in other situations, they might.
by mikeyww
Yesterday, 18:49
Forum: Ask for Help (v2)
Topic: Error: Hotkeys/hotstrings are not allowed inside functions or classes.
Replies: 13
Views: 96

Re: Error: Hotkeys/hotstrings are not allowed inside functions or classes.

That is not the bug. The hotkeys would be stacked by removing the second brace. Multiple hotkeys can be stacked vertically to have them perform the same action. For example: ^Numpad0:: ^Numpad1:: { MsgBox "Pressing either Ctrl+Numpad0 or Ctrl+Numpad1 will display this." } Source: Hotkeys - Definitio...
by mikeyww
Yesterday, 18:37
Forum: Ask for Help (v2)
Topic: Error: Hotkeys/hotstrings are not allowed inside functions or classes.
Replies: 13
Views: 96

Re: Error: Hotkeys/hotstrings are not allowed inside functions or classes.

Code: Select all

#Requires AutoHotkey v2.0
winTitle := 'ahk_exe HD-Player.exe'
; winTitle := 'ahk_exe Notepad.exe'

#HotIf WinActive(winTitle)
Up::
Del:: {
 While GetKeyState(ThisHotkey, 'P')
  MouseMove 0, 10, 1, 'R'
}
#HotIf
by mikeyww
Yesterday, 18:30
Forum: Ask for Help (v2)
Topic: Use \ or Eject key to delete
Replies: 1
Views: 26

Re: Use \ or Eject key to delete

Ideas are below.

Code: Select all

#Requires AutoHotkey v2.0
$\::Send '{Del}'
^\::Send '\'
You could see whether Eject has a :arrow: scan code.
by mikeyww
Yesterday, 12:01
Forum: Ask for Help (v1)
Topic: Script unable to close program
Replies: 1
Views: 28

Re: Script unable to close program

The script below worked on Win 11. #Requires AutoHotkey v1.1.33.11 player := "Media Player ahk_class ApplicationFrameWindow" #If WinExist(player) ^!c:: WinClose MsgBox 64, Status, Closed! Return #If If you are new to AHK, I recommend using its current version, which is v2, instead of this older depr...
by mikeyww
Yesterday, 11:12
Forum: Ask for Help (v2)
Topic: rebind error Topic is solved
Replies: 7
Views: 103

Re: rebind error Topic is solved

I tried one of your hotkeys here (without your other program, of course), and it worked. My approach to troubleshooting this would be to test a shorter and simpler script to understand how your program is using and responding to hotkeys. The following script might show whether you can trigger and se...
by mikeyww
Yesterday, 11:05
Forum: Ask for Help (v2)
Topic: Menu-item hotkey does not work the very first time only
Replies: 9
Views: 105

Re: Menu-item hotkey does not work the very first time only

I'm not sure why you are seeing that effect, not replicated here. Perhaps others will have more insight into your problem here. I would recommend closing all script and programs, and then running a simple test script. #Requires AutoHotkey v2.0 m := Menu() m.Add '&1 abc', paste b::m.Show paste(itemNa...
by mikeyww
Yesterday, 07:54
Forum: Ask for Help (v2)
Topic: Menu-item hotkey does not work the very first time only
Replies: 9
Views: 105

Re: Menu-item hotkey does not work the very first time only

It works here. An example of some streamlining is shown below. GUI can use a font and font size of your choice. If you are testing in Notepad on Win 11, you will find that SendInput does not work there, but SendEvent does. #Requires AutoHotkey v2.0 word := ['Abc', 'Ade', 'Az', 'Bbc', 'Bde', 'Bz'] ve...
by mikeyww
Yesterday, 06:22
Forum: Ask for Help (v2)
Topic: Menu-item hotkey does not work the very first time only
Replies: 9
Views: 105

Re: Menu-item hotkey does not work the very first time only

Welcome to this AutoHotkey forum! It worked here, but you might want to try a regular hotkey, such as F3 , to display your menu. If it does work, it tells you that the custom combination or its specific parts might be interfering. An alternative is to use a one-key hotkey that opens a menu with subm...
by mikeyww
21 Apr 2024, 20:57
Forum: Ask for Help (v1)
Topic: Sendinput Won't Send ! Within A Variable
Replies: 10
Views: 92

Re: Sendinput Won't Send ! Within A Variable

As shown above, to use text mode, prepend your text with {Text}.

Code: Select all

#Requires AutoHotkey v1.1.33.11
str := "!E@#$%^f"
Send % "{Text}" str
by mikeyww
21 Apr 2024, 17:02
Forum: Ask for Help (v1)
Topic: Sendinput Won't Send ! Within A Variable
Replies: 10
Views: 92

Re: Sendinput Won't Send ! Within A Variable

When you tried text mode, what happened? What was your script?
by mikeyww
21 Apr 2024, 16:55
Forum: Ask for Help (v2)
Topic: Run "i_view64.exe" and other programs moving the mouse cursor?!
Replies: 7
Views: 129

Re: Run "i_view64.exe" and other programs moving the mouse cursor?!

When you revise a script, please do not edit your post. Create a new reply. Tested without any problems here. This may be easy to debug if you close all other programs, scripts, macros, keyboard utilities, mouse utilities, clipboard utilities, and tray-resident programs. Re-test. Use only the script...
by mikeyww
21 Apr 2024, 16:53
Forum: Ask for Help (v1)
Topic: Choose csv file to read from and send input to an opened app Topic is solved
Replies: 3
Views: 53

Re: Choose csv file to read from and send input to an opened app Topic is solved

#Requires AutoHotkey v1.1.33.11 Loop Read, teste.csv Loop Parse, A_LoopReadLine, CSV { Switch A_Index { Case 7: n := A_LoopField - 20 Send % "{" (n < 0 ? "Left" : "Right") " " Abs(n) "}" Default: Send % "{Text}" A_LoopField "`t" } Sleep 500 } My opinion is that, within one row, you are looking at c...
by mikeyww
21 Apr 2024, 16:41
Forum: Ask for Help (v1)
Topic: Sendinput Won't Send ! Within A Variable
Replies: 10
Views: 92

Re: Sendinput Won't Send ! Within A Variable

Explained here: :arrow: Send

See: key names

Alternative: Text mode

Go to advanced search