Search found 1005 matches

by GEV
25 Mar 2023, 09:40
Forum: Ask for Help (v1)
Topic: opening a file type with specific program
Replies: 13
Views: 1678

Re: opening a file type with specific program

getSelected() { ; https://www.autohotkey.com/boards/viewtopic.php?style=17&t=60403#p255256 by teadrinker hwnd := WinExist("A"), selection := [] WinGetClass, class If (class ~= "(Cabinet|Explore)WClass") For window in ComObjCreate("Shell.Application").Windows { Try window.hwnd Catch Return If (windo...
by GEV
16 Mar 2023, 13:20
Forum: Ask for Help (v1)
Topic: How detect the shutdown key
Replies: 15
Views: 659

Re: How detect the shutdown key

You can try to remap it first using an external tool like SharpKeys. But I'm not sure whether it keeps its original scan code afterwards.
by GEV
16 Mar 2023, 09:56
Forum: Ask for Help (v2)
Topic: How to save and restore the active window in v2
Replies: 8
Views: 1164

Re: How to save and restore the active window in v2

Kisang Kim wrote:
16 Mar 2023, 09:49
I hope this helps!
Not in AHK v2
by GEV
16 Mar 2023, 09:38
Forum: Ask for Help (v2)
Topic: How to save and restore the active window in v2
Replies: 8
Views: 1164

Re: How to save and restore the active window in v2

@swagfag
How do you tranlate this

v1

Code: Select all

F1:: 
	winid := ""
	WinGet, winid, ID, A ; Save the current active window ID
return

F2::WinActivate ahk_id %winid%  ; Activate the stored window
in v2
?
by GEV
24 Jan 2023, 16:13
Forum: Ask for Help (v1)
Topic: Can this code be optimized/ fixed to make long press better and avoid unwanted haptic delays?
Replies: 1
Views: 250

Re: Can this code be optimized/ fixed to make long press better and avoid unwanted haptic delays?

Try

Code: Select all

$z::
	KeyWait, z
return

$z Up::
	If (A_PriorHotKey = "$z" AND A_TimeSincePriorHotkey < 400)
	  Send, {Del}
	else
		Send, 0
return
by GEV
14 Dec 2022, 15:23
Forum: Ask for Help (v1)
Topic: Wait for a program to fully open
Replies: 2
Views: 699

Re: Wait for a program to fully open

Code: Select all

WinWait, WinTitle, WinText, 40
do something
does something as soon as the the window appears within the 40 seconds (waits maximal 40 seconds).

Same with WinWaitActive.

To wait for a new window see WinWaitCreated()
by GEV
26 Oct 2022, 03:50
Forum: Ask for Help (v1)
Topic: Get the path knowing the current window and process?
Replies: 10
Views: 1091

Re: Get the path knowing the current window and process?

Then you browse the images in the same folder, I suppose. As soon as you have the folder path of the first file its easy to get the path of them that follow.
by GEV
25 Oct 2022, 15:54
Forum: Ask for Help (v1)
Topic: Get the path knowing the current window and process?
Replies: 10
Views: 1091

Re: Get the path knowing the current window and process?

If nothing else helps, you can try this: ; Get the path of the recent items folder RegRead, Recent, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, Recent F1:: WinGetActiveTitle, active_title ; replace " - ACDSee" by the part of the window title after the filename (if present...
by GEV
17 Oct 2022, 05:32
Forum: Ask for Help (v1)
Topic: Simple for in loop, simple array Topic is solved
Replies: 6
Views: 2899

Re: Simple for in loop, simple array Topic is solved

To retrieve an item you have to use Array[Index]

Code: Select all

Array := ["false","true","false"]
for index in Array
	if inStr(Array[index], "false")
		MsgBox, false detected
https://www.autohotkey.com/docs/Objects.htm#Usage_Simple_Arrays
by GEV
13 Oct 2022, 12:20
Forum: Ask for Help (v1)
Topic: Script With Modifier Keys Working Differently
Replies: 6
Views: 561

Re: Script With Modifier Keys Working Differently

Is it simply possible not to send RButton when LShift + RButton are pressed together, but to retain the default function of RButton when it is pressed alone? Not that I know of. You can also try something like this: ~RButton & ~LShift:: KeyWait, RButton CloseContextMenu() SoundBeep Return CloseCont...
by GEV
13 Oct 2022, 07:35
Forum: Ask for Help (v1)
Topic: Script With Modifier Keys Working Differently
Replies: 6
Views: 561

Re: Script With Modifier Keys Working Differently

To close the context menu you can try

Code: Select all

~RButton & ~LShift::
	KeyWait, RButton
	SendInput, {Esc}
	SoundBeep
Return
by GEV
12 Oct 2022, 14:01
Forum: Ask for Help (v1)
Topic: Script With Modifier Keys Working Differently
Replies: 6
Views: 561

Re: Script With Modifier Keys Working Differently

The tilde prefix (~) prevents AHK from blocking the key-down/up events. It can be used with either the prefix or suffix keys, or both of them. If a tilde is applied to the prefix key of any custom combination which has not been turned off or suspended, it affects the behavior of that prefix key for ...
by GEV
12 Oct 2022, 09:37
Forum: Ask for Help (v1)
Topic: WinWait alternitive Topic is solved
Replies: 13
Views: 1571

Re: WinWait alternitive Topic is solved

RussF wrote:
12 Oct 2022, 09:21
@GEV - how does adding a timeout help here? AHK sees

Code: Select all

WinWait, Save As,, 30
the same as

Code: Select all

WinWait, Save As - unresponsive,, 30
.
If you add

Code: Select all

SetTitleMatchMode, 3
before the command then
WinWait, Save As
is not the same as
WinWait, Save As - unresponsive
by GEV
12 Oct 2022, 08:57
Forum: Ask for Help (v1)
Topic: WinWait alternitive Topic is solved
Replies: 13
Views: 1571

Re: WinWait alternitive Topic is solved

You can add a timeout to the commands WinWait or/and WinWaitActive and use ErrorLevel as in the examples
https://www.autohotkey.com/docs/commands/WinWait.htm#ExBasic
https://www.autohotkey.com/docs/commands/WinWaitActive.htm#ExBasic

See also
WinWaitCreated()
by GEV
12 Oct 2022, 03:05
Forum: Ask for Help (v1)
Topic: How to insert blocks of raw text?
Replies: 5
Views: 920

Re: How to insert blocks of raw text?

If you often have to send such a complex or long text, you can create a function, for not repeating the whole code every time: :*:onevent\:: my_text = ( onEvent('recipes', event => { removeRecipeByOutput`(event, [ '' ]`) event.shaped('', [ '', '', '' ], { X: '', }) }) ) Send(my_text) return Send(tex...
by GEV
11 Oct 2022, 13:46
Forum: Ask for Help (v1)
Topic: How to insert blocks of raw text?
Replies: 5
Views: 920

Re: How to insert blocks of raw text?

The simplest and fastest method in this case is the use of the Clipboard, AFAIK: :*:onevent\:: ; hotstring ClipSaved := ClipboardAll ; save the entire clipboard to the variable ClipSaved clipboard := "" ; empty the clipboard (start off empty to allow ClipWait to detect when the text has arrived) cli...
by GEV
09 Oct 2022, 15:23
Forum: Ask for Help (v1)
Topic: Blocking Mouse Wheel within a thread temporarily... How? Topic is solved
Replies: 2
Views: 451

Re: Blocking Mouse Wheel within a thread temporarily... How? Topic is solved

You can disable the mouse wheel within a thread temporarily by using a boolean variable: ; begin of thread Wheel_disabled := true ; set the boolean variable Wheel_disabled to true ; code Wheel_disabled := false return ; end of thread #If (Wheel_disabled) WheelUp:: WheelDown:: return ; do nothing #If

Go to advanced search