Search found 27203 matches
- Today, 11:52
- Forum: General Discussion
- Topic: which version is better for system v1 or v2.
- Replies: 1
- Views: 141
Re: which version is better for system v1 or v2.
Hello, You can continue to run v1 scripts without difficulty. For new scripts, you may wish to use v2. I would recommend that. These two major versions can co-exist; installing v2 does not alter v1. Changes are noted below. https://www.autohotkey.com/docs/v2/v2-changes.htm V1 is no longer being deve...
- Yesterday, 06:29
- Forum: Ask for Help (v2)
- Topic: ahk documentation questions
- Replies: 8
- Views: 368
Re: ahk documentation questions
You can use a map object.
Code: Select all
#Requires AutoHotkey v2.0
obj1 := Map(
'name', 'mary'
, 'int2', 16
)
MsgBox myfunc(obj1['int2']), 'Result', 'Iconi'
myfunc(n) {
Return Sqrt(n)
}
- 24 May 2024, 15:20
- Forum: Ask for Help (v2)
- Topic: Click if an image is visible Topic is solved
- Replies: 6
- Views: 275
Re: Click if an image is visible Topic is solved
I would start by capturing a simple static image from your screen as a PNG file, and then using that in your testing to see if ImageSearch works. If it fails, then it typically means that the image is not visible or that the coordinates are wrong. If using default coordinates, then the point of refe...
- 24 May 2024, 13:42
- Forum: Ask for Help (v2)
- Topic: Click if an image is visible Topic is solved
- Replies: 6
- Views: 275
Re: Click if an image is visible Topic is solved
So you added the image. What happened next?
- 24 May 2024, 11:10
- Forum: Ask for Help (v2)
- Topic: Click if an image is visible Topic is solved
- Replies: 6
- Views: 275
Re: Click if an image is visible Topic is solved
Hello, "Does not work" does not explain what your script does when you run it. Is your hotkey ever triggered? If so, how do you know? What does the script actually do? What value does the search return? Are your coordinates relative to the active window's client area? If not, adjust, or use CoordMod...
- 24 May 2024, 11:02
- Forum: Ask for Help (v2)
- Topic: how to make a list box
- Replies: 11
- Views: 464
Re: how to make a list box
#Requires AutoHotkey v2.0 g := Gui(, 'Select') g.SetFont 's10' g.AddRadio 'w230 vrad', 'Opt1' g.AddRadio 'wp' , 'Opt2' g.AddRadio 'wp' , 'Opt3' g.AddRadio 'wp' , 'Opt4' g.AddButton('wp Default', 'Go').OnEvent('Click', btn_Click) g.Show btn_Click(btn, info) { form := g.Submit() Switch form.rad { Cas...
- 24 May 2024, 07:40
- Forum: Ask for Help (v2)
- Topic: Convert run and &PID from v1
- Replies: 5
- Views: 370
Re: Convert run and &PID from v1
The first example shows how you can retrieve an unexpected PID or the wrong PID. The second example shows how to get a window's HWND after you run a program. My understanding is that Windows 11 (and perhaps Windows 10, but I do not recall) changed the programs used for CMD shell; not a great concern...
- 24 May 2024, 06:35
- Forum: Ask for Help (v1)
- Topic: How to detect if a screenshot is all black? Topic is solved
- Replies: 1
- Views: 320
Re: How to detect if a screenshot is all black? Topic is solved
Hello,
This might be done simply by ImageSearch if you search for a black image and then check the ErrorLevel from the search.
This might be done simply by ImageSearch if you search for a black image and then check the ErrorLevel from the search.
- 23 May 2024, 19:50
- Forum: Ask for Help (v2)
- Topic: When is a text file ready to read?
- Replies: 5
- Views: 269
Re: When is a text file ready to read?
Try it and see. You will be the person who decides upon the definition of a "completed" file. Various definitions could be crafted.
Most likely, a text file can be read when it exists, but you can try it to confirm. You are able to answer your question by running your script.
Most likely, a text file can be read when it exists, but you can try it to confirm. You are able to answer your question by running your script.
- 23 May 2024, 18:53
- Forum: Ask for Help (v2)
- Topic: a hierarch of presession ?
- Replies: 1
- Views: 140
Re: a hierarch of presession ?
Hello, KeyWait with a timeout will wait for the timeout or the wait condition to be met, whichever comes first. With default thread priorities, a triggered hotkey interrupts other threads unless the other thread uses an uninterruptible statement. An interrupted thread resumes when the interrupting t...
- 23 May 2024, 16:55
- Forum: Ask for Help (v2)
- Topic: Autohotkey 3 Side Buttons on mouse. Topic is solved
- Replies: 5
- Views: 324
Re: Autohotkey 3 Side Buttons on mouse. Topic is solved
Yes. First, install the keyboard hook and mouse hook in your script. Second, if you have no luck with it, then check to see whether a scan code is identified.
- 23 May 2024, 16:25
- Forum: Ask for Help (v1)
- Topic: The print screen command doesnt work anymore
- Replies: 2
- Views: 347
Re: The print screen command doesnt work anymore
Hello,
You can try the following script, with no changes and no additions. Close all other scripts before running it.
You can try the following script, with no changes and no additions. Close all other scripts before running it.
Code: Select all
#Requires AutoHotkey v1.1.33.11
F3::Run SnippingTool.exe /Clip
- 23 May 2024, 14:35
- Forum: Ask for Help (v1)
- Topic: Clipboard Stopped Working ... AHK Scripts Won't Run
- Replies: 18
- Views: 1191
Re: Clipboard Stopped Working ... AHK Scripts Won't Run
That's helpful information and seems to get a step closer to the problem, though I cannot pinpoint it exactly. If the script reads the text file exactly when the file is actually changing, I am not sure what happens. In any case, this information might help other readers to know what is causing the ...
- 23 May 2024, 11:33
- Forum: Ask for Help (v2)
- Topic: When is a text file ready to read?
- Replies: 5
- Views: 269
Re: When is a text file ready to read?
Mine is below.
Code: Select all
#Requires AutoHotkey v2.0
fPath := 'test.txt'
txt := read(fPath)
MsgBox txt, 'Text', 'Iconi'
read(fPath) {
Loop {
Try FileRead(fPath)
Catch {
SoundBeep 1500
Sleep 900
} Else {
Sleep 1500
Return FileRead(fPath)
}
}
}
- 23 May 2024, 06:47
- Forum: Gaming
- Topic: Double tap key + hold
- Replies: 2
- Views: 193
Re: Double tap key + hold
A variation is below.
Code: Select all
#Requires AutoHotkey v2.0
$w:: {
Send 'w'
If !KeyWait('w', 'T.3') {
Send '{w down}'
SoundBeep 1500
KeyWait 'w'
Send '{w up}'
SoundBeep 1000
}
}
- 22 May 2024, 08:29
- Forum: Ask for Help (v2)
- Topic: Ctrl+tab and shift+ctrl+tab
- Replies: 5
- Views: 292
Re: Ctrl+tab and shift+ctrl+tab
Hello,
The documentation may help you. Below is an example of how to use expressions with Send.
https://www.autohotkey.com/docs/v2/lib/Send.htm#ExBrace
The documentation may help you. Below is an example of how to use expressions with Send.
https://www.autohotkey.com/docs/v2/lib/Send.htm#ExBrace
- 22 May 2024, 05:43
- Forum: Ask for Help (v2)
- Topic: With keyboard launcher (Run command), Win + key is not focused. Is this on spec of Windows?
- Replies: 5
- Views: 280
Re: With keyboard launcher (Run command), Win + key is not focused. Is this on spec of Windows?
I reproduced your issue a couple of times and saw it noted in some Windows forums. You could try the following as a workaround. Adjust the WinTitle and program as needed. #Requires AutoHotkey v2.0 #e Up:: ^!e Up:: { Run 'calc' If WinWait('Calculator ahk_class ApplicationFrameWindow',, 3) WinActivate...
- 22 May 2024, 04:00
- Forum: Ask for Help (v2)
- Topic: With keyboard launcher (Run command), Win + key is not focused. Is this on spec of Windows?
- Replies: 5
- Views: 280
Re: With keyboard launcher (Run command), Win + key is not focused. Is this on spec of Windows?
Welcome to this AutoHotkey forum! The script that you posted worked here when I used calc.exe instead of calc1.exe. A different script may yield different results, and a different Calculator program may yield different results. Your description refers to a hotkey that is not in your script. My AHK v...
- 21 May 2024, 19:30
- Forum: Ask for Help (v1)
- Topic: Clipboard Stopped Working ... AHK Scripts Won't Run
- Replies: 18
- Views: 1191
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...
- 21 May 2024, 15:20
- Forum: Gaming Help (v1)
- Topic: Need some help with key pressing please!
- Replies: 5
- Views: 431
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