Search found 45 matches

by geekyadam
24 May 2023, 10:24
Forum: Ask for Help (v2)
Topic: How to send AHK scripts via email attachment?
Replies: 2
Views: 323

How to send AHK scripts via email attachment?

Whenever I try to attach a .zip in a gmail that contains AHK scripts I get a security error and I can't send the email. I need to email myself a .zip file containing multiple folders which contain multiple AHK scripts. Any ideas how to achieve this?
by geekyadam
15 Mar 2022, 14:56
Forum: Ask for Help (v1)
Topic: How to prevent !4::F4 from sending Alt+F4 Topic is solved
Replies: 2
Views: 386

Re: How to prevent !4::F4 from sending Alt+F4 Topic is solved

Well crap. No idea why I didn't try that already. Thanks.
by geekyadam
15 Mar 2022, 14:05
Forum: Ask for Help (v1)
Topic: How to prevent !4::F4 from sending Alt+F4 Topic is solved
Replies: 2
Views: 386

How to prevent !4::F4 from sending Alt+F4 Topic is solved

I have a program that uses F4 for a specific action. I want Alt+4 to send F4: !4::F4 The F4 key is sent to the active window successfully, but since Alt is the modifier to trigger the hotkey, AHK inherently sends Alt+F4 to the operating system at the same time, closing my active window. I don't want...
by geekyadam
11 Mar 2022, 18:01
Forum: Scripts and Functions (v1)
Topic: Send audio to specific sound device without libraries or complicated code
Replies: 2
Views: 1910

Re: Send audio to specific sound device without libraries or complicated code

Yes I want to echo thanks for this. I've been using Voicemod to alter voice output and use a soundboard for awhile now, and I had a gut feeling that I should be able to get AHK to play sounds via the Voicemod audio device that gets created, and this is the solution. I believe the Voicemod audio devi...
by geekyadam
02 Sep 2021, 13:08
Forum: Ask for Help (v1)
Topic: Longpress Home key
Replies: 8
Views: 797

Re: Longpress Home key

I got it to work by putting the Shift down and Ctrl down sends on the same line as End/Home sends: ; longpress Home for End *Home:: KeyWait, Home, T.5 If %ErrorLevel% { if (GetKeyState("Shift") and GetKeyState("Ctrl")) Send {Shift down}{Ctrl down}{End} else if GetKeyState("Shift") Send {Shift down}{...
by geekyadam
02 Sep 2021, 12:43
Forum: Ask for Help (v1)
Topic: Longpress Home key
Replies: 8
Views: 797

Re: Longpress Home key

The key repeats when you hold it, so you can wait for the release. $Home:: KeyWait, Home, T.5 Send % ErrorLevel ? "{End}" : "{Home}" KeyWait, Home Return That extra KeyWait solved that issue, thanks! However now I have a new issue...I can't get Shift and Ctrl to work correctly with the hotkey. Here...
by geekyadam
01 Sep 2021, 20:10
Forum: Ask for Help (v1)
Topic: Longpress Home key
Replies: 8
Views: 797

Longpress Home key

I'm having a very hard time remapping longpress of the Home key to act as the End key. I started by trying to copy my working code for longpress of the Escape key... $Escape:: KeyWait, %A_ThisHotkey%, T.5 If %ErrorLevel% WinMinimize, A else Send {Escape} Return $Home:: KeyWait, %A_ThisHotkey%, T.5 I...
by geekyadam
24 Aug 2021, 10:43
Forum: Ask for Help (v1)
Topic: Has anyone wrote a hotkey for Slack to close/leave?
Replies: 7
Views: 894

Re: Has anyone wrote a hotkey for Slack to close/leave?

Just FYI for anyone else going the same route, SendMode Input doesn't support SetKeyDelay, so you have to either set SendMode to something other than Input up in auto-exec section, or just use SendEvent or SendPlay within the hotkey. For example, here's my hotkey to leave a channel in Slack: ^w:: Se...
by geekyadam
23 Aug 2021, 15:58
Forum: Ask for Help (v1)
Topic: Has anyone wrote a hotkey for Slack to close/leave?
Replies: 7
Views: 894

Re: Has anyone wrote a hotkey for Slack to close/leave?

The defaults for SendEvent mode is: SetKeyDelay, 10, -1 That should work give it a try If you have multiple hotkeys you can test this example and see its per thread (hotkeys create a new thread) ;~ SetKeyDelay, 10, -1 ; default setting in autoexec section (top of the script) $n::Send, This is a tes...
by geekyadam
23 Aug 2021, 10:20
Forum: Ask for Help (v1)
Topic: Has anyone wrote a hotkey for Slack to close/leave?
Replies: 7
Views: 894

Re: Has anyone wrote a hotkey for Slack to close/leave?

Try: SetKeyDelay, 200, 50 ^w::Send, /leave{ENTER 2} Thanks for that, I could just use setkeydelay rather than adding individual sleeps. Please remind me...what would the command be to reset SetKeyDelay back to defaults afterward? Looking at docs, there isn't just a default parameter, so I think I'd...
by geekyadam
20 Aug 2021, 12:43
Forum: Ask for Help (v1)
Topic: Has anyone wrote a hotkey for Slack to close/leave?
Replies: 7
Views: 894

Has anyone wrote a hotkey for Slack to close/leave?

Slack has many keyboard shortcuts, however closing or leaving a conversation is not one of them. Within Slack, it can be accomplished in one of three ways from what I can tell: 1. Right-click conversation in left sidebar, choose "Close conversation" 2. Click the little "x" on the right side of a con...
by geekyadam
27 Jul 2021, 15:08
Forum: Ask for Help (v1)
Topic: Detect when Windows screen lock/password is active
Replies: 14
Views: 10017

Re: Detect when Windows screen lock/password is active

This may have changed with (maybe a recent release of) Windows 10. I dunno how consistent it is, but calling WinGetTitle,ID,A returns "Windows Default Lock Screen" into ID for me. Just FYI, I just tried running this and immediately locking my laptop (Win+L)... Sleep 5000 WinGetTitle,ID,A msgbox %ID...
by geekyadam
08 Apr 2020, 10:48
Forum: Scripts and Functions (v1)
Topic: Toggle Microphone Mute
Replies: 34
Views: 79613

Re: Toggle Microphone Mute

Found this code via YT video (https://www.youtube.com/watch?v=JV7fPXIpm8A) and works great in Windows 10. Thanks for the code! #creditwheredue
by geekyadam
30 Jan 2020, 10:20
Forum: Ask for Help (v1)
Topic: How to prevent script(s) from exitting when I change the power source of my Laptop
Replies: 7
Views: 1887

Re: How to prevent script(s) from exitting when I change the power source of my Laptop

Sorry to necro old threads but I wanted to add something for anyone else experiencing similar behavior that might help them... Theoretically a docking station or USB hub could have a USB flash drive or external drive attached, and it could be possible that AHK was installed to that location. If you ...
by geekyadam
23 Apr 2019, 15:42
Forum: Ask for Help (v1)
Topic: Can't get WinActivate to activate Microsoft Teams
Replies: 24
Views: 10388

Re: Can't get WinActivate to activate Microsoft Teams

Okay so two of the ~15 IDs activate the Teams window: 0xb0c02 and 0x205ac
Not sure which I should use...I might actually just use the Loop for the winactivate to be sure it gets activated...
by geekyadam
23 Apr 2019, 15:33
Forum: Ask for Help (v1)
Topic: Can't get WinActivate to activate Microsoft Teams
Replies: 24
Views: 10388

Re: Can't get WinActivate to activate Microsoft Teams

Wait, scratch that, I forgot the % characters around thisID in the winactivate line...
by geekyadam
23 Apr 2019, 15:32
Forum: Ask for Help (v1)
Topic: Can't get WinActivate to activate Microsoft Teams
Replies: 24
Views: 10388

Re: Can't get WinActivate to activate Microsoft Teams

I just looped through all the IDs and tried activating them. None of them activated the actual Teams window. WinGet winlist, list, ahk_exe Teams.exe Loop %winlist% { thisID := winlist%A_Index% fullwinlist := fullwinlist . thisID . "`r`n" WinActivate ahk_id thisID msgbox activated ID %thisID% }
by geekyadam
23 Apr 2019, 12:53
Forum: Ask for Help (v1)
Topic: Can't get WinActivate to activate Microsoft Teams
Replies: 24
Views: 10388

Re: Can't get WinActivate to activate Microsoft Teams

You could try WinGet Count. If the count is 0, you have a problem, if it is greater than 1, you might have to use WinGet List, to get the right window. WinGet, vCount, Count, ahk_class Notepad MsgBox, % vCount Also, you may want to turn DetectHiddenWindows on/off. DetectHiddenWindows has always bee...
by geekyadam
23 Apr 2019, 11:20
Forum: Ask for Help (v1)
Topic: Can't get WinActivate to activate Microsoft Teams
Replies: 24
Views: 10388

Re: Can't get WinActivate to activate Microsoft Teams

jeeswg wrote:
23 Apr 2019, 11:05
Did you try running as admin?
No change in behavior.
by geekyadam
23 Apr 2019, 11:02
Forum: Ask for Help (v1)
Topic: Can't get WinActivate to activate Microsoft Teams
Replies: 24
Views: 10388

Re: Can't get WinActivate to activate Microsoft Teams

AHK v1 and v2 have WinActive(), which checks if a window is active. Only AHK v2 has WinActivate(). Although you can backport it to AHK v1. E.g.: commands as functions (AHK v2 functions for AHK v1) - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=37&t=29689 Also, I see that "comm...

Go to advanced search