Search found 27185 matches

by mikeyww
Today, 19:30
Forum: Ask for Help (v1)
Topic: Clipboard Stopped Working ... AHK Scripts Won't Run
Replies: 16
Views: 897

Re: Clipboard Stopped Working ... AHK Scripts Won't Run

Others here may know the way. How and when are you running your four-line script file? It just runs and then exits immediately afterwards? What is in your text file when the script fails? Have you confirmed that the script successfully reads your text file? Can you post a screenshot of the error mes...
by mikeyww
Today, 15:20
Forum: Gaming Help (v1)
Topic: Need some help with key pressing please!
Replies: 5
Views: 226

Re: Need some help with key pressing please!

Test in Notepad to see how it works. Use this script with no other code and no other scripts running.

Code: Select all

#Requires AutoHotkey v1.1.33.11

*2::
SetKeyDelay 25, 25
While GetKeyState("2", "P")
 SendEvent {Blind}2
Return
by mikeyww
Today, 13:10
Forum: Ask for Help (v2)
Topic: Script Goes To wrong Screen
Replies: 4
Views: 204

Re: Script Goes To wrong Screen

In v2, coordinates are relative to the active window's client area unless CoordMode is used to change that.
by mikeyww
Today, 12:57
Forum: Ask for Help (v2)
Topic: Script Goes To wrong Screen
Replies: 4
Views: 204

Re: Script Goes To wrong Screen

Welcome to this AutoHotkey forum! Coordinates are relative to the active window's client area unless CoordMode was used to change that. Source: Click - Syntax & Usage | AutoHotkey v2 Run Window Spy to see the coordinates. Throughout your function, there might be a series of multiple, different activ...
by mikeyww
Today, 09:04
Forum: Ask for Help (v1)
Topic: center a window of a .bat file in the center of a screen without knowing the size of the screen?
Replies: 9
Views: 397

Re: center a window of a .bat file in the center of a screen without knowing the size of the screen?

Code: Select all

@echo off
D:\temp2\centerWindow.ahk "A"
Pause
EXIT

Code: Select all

#Requires AutoHotkey v1.1.33.11
#NoTrayIcon
If A_Args.Length()
 centerWindow(A_Args[1])
ExitApp

centerWindow(winTitle) {
 If WinExist(winTitle) {
  WinGetPos,,, w, h
  WinRestore
  WinMove (A_ScreenWidth  - w) / 2, (A_ScreenHeight - h) / 2
 }
}
by mikeyww
Today, 08:55
Forum: Gaming Help (v1)
Topic: Need some help with key pressing please!
Replies: 5
Views: 226

Re: Need some help with key pressing please!

You can try blind mode with your Send.

Code: Select all

SendEvent {Blind}1
Ensure that you are using the wildcard hotkey modifier as shown.
by mikeyww
Today, 07:41
Forum: Gaming Help (v1)
Topic: Need some help with key pressing please!
Replies: 5
Views: 226

Re: Need some help with key pressing please!

Welcome to this AutoHotkey forum! Whether a script works depends on what you want the script to do. I suggest that you provide a description of that. If you are new to AHK, I recommend using its current version, which is v2, instead of this older deprecated version that is no longer developed. #Requ...
by mikeyww
Today, 07:39
Forum: Ask for Help (v2)
Topic: VSCode fails with V2 Debugger
Replies: 4
Views: 131

Re: VSCode fails with V2 Debugger

Welcome to this AutoHotkey forum!

Probably your mistake, but if you have a script that does not work, you can post it in the forum to get specific feedback about it.
by mikeyww
Today, 07:28
Forum: Ask for Help (v1)
Topic: Need help please
Replies: 1
Views: 149

Re: Need help please

Welcome to this AutoHotkey forum! You are mistaken. Code following an infinite loop (within the same thread) does not execute because the loop is infinite. I would shorten your script, re-test, and then be more specific about what your script does, and what it should do, step by step. Include an exa...
by mikeyww
Today, 05:08
Forum: Ask for Help (v2)
Topic: Create an infinite TAB key loop Topic is solved
Replies: 2
Views: 113

Re: Create an infinite TAB key loop Topic is solved

Welcome to this AutoHotkey forum! The AHK documentation may be a useful reference for you. This forum can also be searched for any sort of issue or solution. You may find that your questions have already been answered, once or hundreds of times! Enjoy. #Requires AutoHotkey v2.0 F3:: { Static on := F...
by mikeyww
Yesterday, 19:42
Forum: Ask for Help (v1)
Topic: SoundGet Mute Is Reversed how to undo that Topic is solved
Replies: 3
Views: 357

Re: SoundGet Mute Is Reversed how to undo that Topic is solved

Hello,

When the sound is muted, the muting is on.
by mikeyww
Yesterday, 18:20
Forum: Ask for Help (v2)
Topic: How to loop 2 keys press for x times Topic is solved
Replies: 2
Views: 137

Re: How to loop 2 keys press for x times Topic is solved

Welcome to this AutoHotkey forum! You'll need to change the syntax to be v2 syntax. You can find all of that syntax, including examples, in the documentation. V2 uses expressions throughout. #Requires AutoHotkey v2.0 Send '{Enter}' #Requires AutoHotkey v2.0 ^3:: { Loop 20 { Send '{a}' Sleep 1000 Sen...
by mikeyww
Yesterday, 17:40
Forum: Ask for Help (v1)
Topic: Clipboard Stopped Working ... AHK Scripts Won't Run
Replies: 16
Views: 897

Re: Clipboard Stopped Working ... AHK Scripts Won't Run

You indicated that the script usually works. Are you running other scripts or programs that also manage or interact with the clipboard at the same time? That is my only thought. Others here may have more insight into this. Incidentally, := does not need to force an expression via % because it is alw...
by mikeyww
Yesterday, 17:06
Forum: Ask for Help (v2)
Topic: Convert run and &PID from v1
Replies: 3
Views: 235

Re: Convert run and &PID from v1

The pipe is not an AHK parameter; it is part of your command line. The PID is an AHK parameter. Thus, use the syntax that AHK provides, as follows. ExitCode := RunWait(Target [ , WorkingDir, Options, &OutputVarPID ] ) The target is your entire command line. Some programs will not return a PID or wil...
by mikeyww
Yesterday, 14:58
Forum: Ask for Help (v2)
Topic: CoordMode confusion... Topic is solved
Replies: 2
Views: 188

Re: CoordMode confusion... Topic is solved

Yes. The page that you cited notes the following possible target types: ToolTip, Pixel, Mouse, Caret, and Menu. Take your pick.
by mikeyww
Yesterday, 14:55
Forum: Ask for Help (v2)
Topic: Convert run and &PID from v1
Replies: 3
Views: 235

Re: Convert run and &PID from v1

Hello, "Doesn't work" says nothing about what your script does, and nothing about what your script should do. I did not test it, but a few tips are below. One script has two RunWait commands. The other does not use RunWait and does not have two such calls, but only one, so there are at least two dif...
by mikeyww
Yesterday, 14:52
Forum: Ask for Help (v2)
Topic: Get and set caret (cursor) position (focus?)
Replies: 1
Views: 135

Re: Get and set caret (cursor) position (focus?)

Hello,

This may or may not work, depending on your situation. :arrow: CaretGetPos
by mikeyww
Yesterday, 14:50
Forum: Ask for Help (v2)
Topic: After pressing a shortcut key, start a commad, and then press the same shortcut key to run a script or exit process B. Topic is solved
Replies: 2
Views: 143

Re: After pressing a shortcut key, start a commad, and then press the same shortcut key to run a script or exit process  Topic is solved

Code: Select all

#Requires AutoHotkey v2.0
running := False

F3:: {
 Global running := True
 WinActive('A')
 SetKeyDelay 100
 Loop 12
  If WinExist() {
   If !WinActive()
    WinActivate
   SendEvent A_Index ' '
  }
}

#HotIf running
F3:: {
 RunWait A_WinDir '\System32\notepad.exe'
 Global running := False
}
#HotIf
by mikeyww
19 May 2024, 08:24
Forum: Ask for Help (v1)
Topic: Can not take screenshot using autohotkey via script Topic is solved
Replies: 7
Views: 605

Re: Can not take screenshot using autohotkey via script Topic is solved

I do not know whether that is the problem, but it could be related-- worth exploring in any case. Good luck!

Go to advanced search