Search found 54 matches
- 26 Feb 2021, 16:30
- Forum: Scripts and Functions
- Topic: Copy filepath to clipboard in Windows Explorer
- Replies: 17
- Views: 10477
Re: Copy filepath to clipboard in Windows Explorer
For some reason, if I declare the variable as GLOBAL, Windows Explorer does not "forget" that I copied the filepath when leaving Windows Explorer. (Windows 10) #IfWinActive ahk_class CabinetWClass ; If Windows Explorer window is active #NumpadAdd:: SendInput, ^c Sleep 100 global my_Clipboard my_Clip...
- 15 Feb 2019, 09:01
- Forum: Ask For Help
- Topic: Why Hotkey command does not work inside #IfWinActive? Topic is solved
- Replies: 2
- Views: 565
Re: Why Hotkey command does not work inside #IfWinActive? Topic is solved
I think I got it. I was able to isolate Notepad. Thank you for the tip! My code for test: #SingleInstance Force $a:: Send, a Hotkey, IfWinActive, ahk_exe notepad.exe Hotkey, $a, Key_a, On Hotkey, $b, Disable_B, On return $b:: Send, b Hotkey, IfWinActive, ahk_exe notepad.exe Hotkey, $b, Key_b, On ret...
- 14 Feb 2019, 16:28
- Forum: Ask For Help
- Topic: Why Hotkey command does not work inside #IfWinActive? Topic is solved
- Replies: 2
- Views: 565
Why Hotkey command does not work inside #IfWinActive? Topic is solved
By typing B, the hotkey works normally. After pressing A, B is deactivated. C reloads the script. This routine works perfectly. #SingleInstance Force $a:: ToolTip, Tap B to disable B`, C to reload Hotkey, $b, Disable_B, On return $b:: ToolTip, B enabled Send, B return $c:: Reload return Esc:: ExitAp...
- 14 Feb 2019, 12:29
- Forum: Ask For Help
- Topic: How to make KeyWait ignore another hotkey? Topic is solved
- Replies: 3
- Views: 640
Re: How to make KeyWait ignore another hotkey? Topic is solved
Thank you, guys. The GEV's solution gave me several ideas and I used the variables as the best alternative. Works fine. Thank you. ; How to make KeyWait ignore another hotkey? #SingleInstance Force myKey := "2" $a:: if (myKey = "0") ; Ignore (A = nothing) return if (myKey = "1") ; As key (A = A) Sen...
- 14 Feb 2019, 10:59
- Forum: Ask For Help
- Topic: Shutcuts conflict
- Replies: 5
- Views: 729
Re: Shutcuts conflict
It's because the WinKey needs to be represented with a hashtag (#) instead of a wildcard (*). Wildcard: Fire the hotkey even if extra modifiers are being held down. This is often used in conjunction with remapping keys or buttons. #: Windows logo key. Like this: ; CTRL+WIN+C ^#c::Shutcuts("C--WC") ;...
- 14 Feb 2019, 09:08
- Forum: Ask For Help
- Topic: Shutcuts conflict
- Replies: 5
- Views: 729
Re: Shutcuts conflict
Maybe you need to tell the AHK that hotkeys should work only on the program you want. For example, run this script, open your Notepad, and press Ctrl + Enter. After this, try Ctrl + Enter on your desktop. | v #SingleInstance Force DetectHiddenWindows, On SetTitleMatchMode, 2 #IfWinActive, ahk_exe no...
- 14 Feb 2019, 08:10
- Forum: Ask For Help
- Topic: How to make KeyWait ignore another hotkey? Topic is solved
- Replies: 3
- Views: 640
How to make KeyWait ignore another hotkey? Topic is solved
My KeyWait is sending the contents of another hotkey (Example 1), AND The KeyWait is consuming the key itself (Example 2). My question: How to make KeyWait just wait for the key to be pressed, without triggering another hotkey or sending the key itself? Thanks. Please run this script you will unders...
- 26 Jan 2019, 08:13
- Forum: Ask For Help
- Topic: Is it possible to group multiple SetTimers? Topic is solved
- Replies: 4
- Views: 772
Re: Is it possible to group multiple SetTimers? Topic is solved
Thank you very much. It's perfect. It worked as expected.
My final code:
My final code:
Code: Select all
App := ["PS_ON", "PS_OFF", "AI_ON", "AI_OFF", "BL_ON", "BL_OFF", "HDR_ON", "HDR_OFF", "GIF_ON", "GIF_OFF", "NOX_ON", "NOX_OFF"]
Timer(App)
Timer(var)
{
for each, Label in var
SetTimer, % Label, 250
}
- 26 Jan 2019, 07:37
- Forum: Ask For Help
- Topic: replace key 0 to ctrl
- Replies: 3
- Views: 684
Re: replace key 0 to ctrl
How about that?
Code: Select all
$Numpad0::
while GetKeyState("Numpad0","P")
{
SendEvent, {Ctrl Down}
KeyWait, Numpad0, U
SendEvent, {Ctrl Up}
}
return
- 26 Jan 2019, 07:32
- Forum: Ask For Help
- Topic: Is it possible to group multiple SetTimers? Topic is solved
- Replies: 4
- Views: 772
Re: Is it possible to group multiple SetTimers? Topic is solved
Sorry, I actually want to save characters by not having to repeat "SetTimer," and ", 250" dozen of times, so I thought I'd use the labels as a variable. How I thought it might be: MyLabel := Group(A, B, C, D, E) SetTimer, %MyLabel%, 250 ; <----- Only once. In this case would I use Array? MyLabel := ...
- 26 Jan 2019, 07:08
- Forum: Ask For Help
- Topic: Is it possible to group multiple SetTimers? Topic is solved
- Replies: 4
- Views: 772
Is it possible to group multiple SetTimers? Topic is solved
I have a script that opens other .ahk files when a window is activated, so I need to use SetTimers to "watch" these active windows or not. How is it: SetTimer, PS_ON, 250 SetTimer, PS_OFF, 250 SetTimer, AI_ON, 250 SetTimer, AI_OFF, 250 SetTimer, BL_ON, 250 SetTimer, BL_OFF, 250 SetTimer, HDR_ON, 250...
- 02 Jun 2018, 17:04
- Forum: Ask For Help
- Topic: How to use different variables in the same "if"? Topic is solved
- Replies: 7
- Views: 1478
Re: How to use different variables in the same "if"? Topic is solved
Thank you, jeeswg and Exaskryz. Both work fine. 

- 02 Jun 2018, 16:58
- Forum: Ask For Help
- Topic: How to use different variables in the same "if"? Topic is solved
- Replies: 7
- Views: 1478
Re: How to use different variables in the same "if"? Topic is solved
@swagfag Yes, Main_"A-Z" are string literals. My code is very complex, so I needed a simpler solution. As they are strings, " if var contains " works very well. My final code: if cKey contains Main_B,Main_C,Main_D,Main_E,Main_F gosub, Last_Key Thanks for the answer because it gave me some ideas. Hel...
- 02 Jun 2018, 15:14
- Forum: Ask For Help
- Topic: How to use different variables in the same "if"? Topic is solved
- Replies: 7
- Views: 1478
How to use different variables in the same "if"? Topic is solved
I have several variables that need to go to their respective labels. Instead of repeating "multiple ifs" for each variable, is there a way to group them into a "single if"? I need to learn how turn this: if cKey = Main_B gosub, Last_Key if cKey = Main_C gosub, Last_Key if cKey = Main_D gosub, Last_K...
- 16 May 2018, 07:51
- Forum: Ask For Help
- Topic: [ A_PriorHotkey ] Last hotkey sent: How to ignore LButton? Topic is solved
- Replies: 4
- Views: 856
Re: [ A_PriorHotkey ] Last hotkey sent: How to ignore LButton? Topic is solved
I just put a return for LButton to be ignored by label LastHotKey if the A_PriorHotkey is LButton. Thank you for your help. :D #SingleInstance Force LastHotKey: if (A_ThisHotkey!=A_PriorHotkey) PriorHotkey:=A_PriorHotkey if (IsLabel(PriorHotkey)) { if (A_PriorHotkey = "~LButton") ; LButton is now ig...
- 16 May 2018, 07:16
- Forum: Ask For Help
- Topic: How to avoid LButton (or Click) inside another Hotkey? Topic is solved
- Replies: 2
- Views: 562
Re: How to avoid LButton (or Click) inside another Hotkey? Topic is solved
PERFECT! Thank you very much, Rohwedder! ^o^
- 15 May 2018, 18:41
- Forum: Ask For Help
- Topic: How to avoid LButton (or Click) inside another Hotkey? Topic is solved
- Replies: 2
- Views: 562
How to avoid LButton (or Click) inside another Hotkey? Topic is solved
Is there any way to disable the LButton before this label, and re-enable it after it finishes? I have this label that is working properly in Photoshop. But when I click the mouse (unintentionally), unexpected things happen. Any ideia? Color_Wheel: ; HOW TO DISABLE LBUTTON HERE IN THIS LINE? <-------...
- 14 May 2018, 12:21
- Forum: Ask For Help
- Topic: ToolTip – Center the tip at the x,y coordinates instead of using them for the upper left corner? Topic is solved
- Replies: 9
- Views: 1678
Re: ToolTip – Center the tip at the x,y coordinates instead of using them for the upper left corner? Topic is solved
swagfag, Thank you for your solution. Unfortunately it did not work for me. Here in my PC the ToolTip does not follow the cursor, and appears in the center of my screen only. (...) I apologize for "all this cerimony". I'm not a programmer, so my knowledge about code is very, very poor. (I use AHK to...
- 14 May 2018, 12:00
- Forum: Ask For Help
- Topic: ToolTip – Center the tip at the x,y coordinates instead of using them for the upper left corner? Topic is solved
- Replies: 9
- Views: 1678
Re: ToolTip – Center the tip at the x,y coordinates instead of using them for the upper left corner? Topic is solved
With Sean's solution (to find out the width of any text), I adapted it over the Qysh code. You need to know the font-family and font-size of your operating system for it to work. (In my case, Segoe UI size 9 in Windows 8). I hope this helps someone in the future. Thank you! :) #NoEnv #MaxHotkeysPerI...
- 14 May 2018, 10:39
- Forum: Ask For Help
- Topic: ToolTip – Center the tip at the x,y coordinates instead of using them for the upper left corner? Topic is solved
- Replies: 9
- Views: 1678
Re: ToolTip – Center the tip at the x,y coordinates instead of using them for the upper left corner? Topic is solved
Qysh,
It is not perfect because depending on the letter, if it has smaller width (example: l, i, 1 ...) or greater width (m, o, 8, @) the positioning will change.
But your solution suits me very well. Thank you so much! It helped me a lot.
It is not perfect because depending on the letter, if it has smaller width (example: l, i, 1 ...) or greater width (m, o, 8, @) the positioning will change.
But your solution suits me very well. Thank you so much! It helped me a lot.
