Search found 1002 matches

by GEV
25 Mar 2024, 16:37
Forum: Ask for Help (v1)
Topic: Code to restore minimized window (translated from "codigo para restaurar ventana minimizada")
Replies: 1
Views: 78

Re: Code to restore minimized window (translated from "codigo para restaurar ventana minimizada")

Code: Select all

; Press F1 to restore the last minimized window:

F1::
	arr := []
	WinGet, id, list,,, Program Manager
	Loop, %id%
	{
		this_id := id%A_Index%
		WinGet, state, MinMax, ahk_id %this_id%
		if (state = -1)
			arr.push(this_id)
	}
	last := arr.pop()
	WinRestore, % "ahk_id " last
return
by GEV
25 Mar 2024, 15:32
Forum: Ask for Help (v1)
Topic: Shortcut to copy path of selected file in Explorer Topic is solved
Replies: 7
Views: 1937

Re: Shortcut to copy path of selected file in Explorer Topic is solved

This seems to work both in explorer and on the desktop: #Requires AutoHotkey v2.0 ; Copy the path of selected items in explorer or on the desktop #HotIf WinActive("ahk_class CabinetWClass") || WinActive("ahk_class Progman") q:: A_Clipboard := Explorer_GetSelection() #HotIf Explorer_GetSelection() { ...
by GEV
20 Mar 2024, 12:39
Forum: Ask for Help (v1)
Topic: Shortcut to copy path of selected file in Explorer Topic is solved
Replies: 7
Views: 1937

Re: Shortcut to copy path of selected file in Explorer Topic is solved

Do you have a version of this in autohotkey v2? You can try this #Requires AutoHotkey v2.0 ; Copy the path of selected items in Explorer #HotIf WinActive("ahk_class CabinetWClass") q:: A_Clipboard := Explorer_GetSelection() #HotIf ; https://www.autohotkey.com/boards/viewtopic.php?f=82&p=519087#p514...
by GEV
14 Mar 2024, 09:59
Forum: Ask for Help (v1)
Topic: HELP: AHK Portable
Replies: 1
Views: 93

Re: HELP: AHK Portable

Are you allowed to edit the Registry on your work PC?
If not, the only alternative to the tray menu is to drag n 'drop AutoHotkey files to an open editor.
by GEV
08 Feb 2024, 23:02
Forum: Ask for Help (v1)
Topic: First line in script works but the rest does not execute Topic is solved
Replies: 7
Views: 200

Re: First line in script works but the rest does not execute Topic is solved

From an older documentation: To have more than one command executed by a hotkey, put the first line beneath the hotkey definition and make the last line a return. For example: ... That was easier to understand for beginners. Why is that so? Because 1. Whenever a statement is listed on the same line ...
by GEV
18 Jan 2024, 19:31
Forum: Ask for Help (v1)
Topic: Hotkey when one of two programs are active
Replies: 4
Views: 181

Re: Hotkey when one of two programs are active

The script works for Word, but not for Excel. Am I utilizing the "or" statement incorrectly? The right syntax is #If WinActive("ahk_exe EXCEL.EXE") or WinActive("ahk_exe WINWORD.EXE") The rest of your question isn't clear to me. It needs to be clarified. There are probably much better ways to accom...
by GEV
12 Jan 2024, 10:16
Forum: Ask for Help (v1)
Topic: Selecting text by whole words using mouse click - improve scrip
Replies: 1
Views: 209

Re: Selecting text by whole words using mouse click - improve scrip

For selecting a word, double-clicking is simpler than LWin+click, once you are using the mouse. To select the whole paragraph make a triple-click. To select non successive words hold the Control key and double-click each word. To select successive words double-click the first word, and extend the se...
by GEV
06 Jan 2024, 14:58
Forum: Ask for Help (v2)
Topic: convert a script to v2.
Replies: 4
Views: 365

Re: convert a script to v2.

If you don't want UP to be triggered after e:

Code: Select all

#Requires AutoHotkey v2.0

s::s
s & e::
e & s::Send '#1'
$e::Send 'e'

#HotIf (A_PriorHotKey = "$e" AND A_TimeSincePriorHotkey < 200)

	Up::Send 'x'

#HotIf
by GEV
31 Dec 2023, 11:27
Forum: Ask for Help (v1)
Topic: How to pause or temporarily disable OnClipboardChange? Topic is solved
Replies: 7
Views: 472

Re: How to pause or temporarily disable OnClipboardChange? Topic is solved

Clipboard = %pasteText%
Where do you have the value of the variable pasteText from?
I would use a function like this for pasting long text.
by GEV
22 Dec 2023, 16:44
Forum: Ask for Help (v1)
Topic: Help with switching desktops
Replies: 1
Views: 477

Re: Help with switching desktops

Read Global Variables
to learn how to access global variables within a function.
by GEV
15 Dec 2023, 11:50
Forum: Ask for Help (v1)
Topic: Drive name instead of letter
Replies: 1
Views: 228

Re: Drive name instead of letter

You can try

Code: Select all

DriveGet, list, list
Loop, parse, list 
{ 
    DriveGet, DriveName, Label, %A_LoopField%:
    If (DriveName = "SanDisk")
    {
        FileMoveDir, %A_LoopField%:\My Folder, C:\My Folder
            break
    }
}
by GEV
12 Dec 2023, 12:12
Forum: Ask for Help (v1)
Topic: Copy tooltip text under mouse cursor?
Replies: 8
Views: 631

Re: Copy tooltip text under mouse cursor?

In Firefox i found a window of class MozillaDropShadowWindowClass whose title is the tooltip:

Code: Select all

#IfWinActive ahk_exe firefox.exe

	#c::
		If WinExist("ahk_class MozillaDropShadowWindowClass")
		{
			WinGetTitle, WinTitle, ahk_class MozillaDropShadowWindowClass
			MsgBox, % WinTitle
		}
	return
by GEV
28 Nov 2023, 09:36
Forum: Ask for Help (v1)
Topic: spacebar long press as modifier
Replies: 20
Views: 1111

Re: spacebar long press as modifier

Code: Select all

*Space::
	Send {Blind}{Alt Down}
	KeyWait, Space ; waits for Space to be released
return

*Space Up::
	Send {Blind}{Alt Up}
	If (A_PriorHotKey = "*Space" AND A_TimeSincePriorHotkey < 300)
		Send {Blind}{Space}
return
viewtopic.php?f=76&t=60608&p=482892#p482892
by GEV
26 Nov 2023, 16:04
Forum: Ask for Help (v1)
Topic: ControlSend doesn't work Topic is solved
Replies: 2
Views: 409

Re: ControlSend doesn't work Topic is solved

What happens if you double-click a script with only this code

Code: Select all

ControlSend,, {F14}, ahk_exe MusicBee.exe
or if you replace ScrollLock by another key?
by GEV
26 Nov 2023, 12:43
Forum: Ask for Help (v1)
Topic: How to get caret positon in a text? Topic is solved
Replies: 3
Views: 455

Re: How to get caret positon in a text? Topic is solved

Code: Select all

#Requires AutoHotkey v2.0

F12::{
	If CaretGetPos(&x, &y)
	{
		MouseMove x, y, 0
		Click 3
	}
}
See https://www.autohotkey.com/docs/v2/v2-changes.htm#built-in-variables
by GEV
13 Oct 2023, 06:08
Forum: Ask for Help (v1)
Topic: Unable to restart Windows Explorer with AHK
Replies: 6
Views: 754

Re: Unable to restart Windows Explorer with AHK

You can also try this VBScript: Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2") Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'explorer.exe'") For Each objProcess in colProcess objProcess.Terminate() Next Set objProcess ...
by GEV
08 Oct 2023, 15:34
Forum: Ask for Help (v1)
Topic: HowTo get multiple #if expression working? Topic is solved
Replies: 2
Views: 443

Re: HowTo get multiple #if expression working? Topic is solved

#If !blocker AND WinActive XXXXXXX
WinActive XXXXX is wrong syntax.

WinActive() is a function and its parameters have to be listed in parentheses. If a parameter is a literal string, it should be enclosed in double quotes:

Code: Select all

#If !blocker AND WinActive("ahk_class Notepad")
by GEV
08 Oct 2023, 15:20
Forum: Ask for Help (v1)
Topic: Binding esc to taskkill
Replies: 1
Views: 349

Re: Binding esc to taskkill

See https://www.autohotkey.com/docs/v1/lib/_IfWinActive.htm
If there is something you don't understand, feel free to ask.

Go to advanced search