Search found 19 matches

by WatsonEnterprises
07 Aug 2021, 03:12
Forum: Ask for Help (v1)
Topic: Terminating a Loop Immediately
Replies: 5
Views: 481

Re: Terminating a Loop Immediately

Here's something funny. F1::LoopUntilHotkeyIsPressed("LoopBody_Test", "F2", maxLoops:=4) LoopBody_Test(){ SoundBeep, 500 sleep 100 SoundBeep, 800 sleep 500 } LoopUntilHotkeyIsPressed(loopBody, terminationKey, maxLoopCount:=""){ loop := new HotkeyTerminatedLoop(loopBody, terminationKey, maxLoopCount)...
by WatsonEnterprises
08 Jul 2021, 00:15
Forum: Ask for Help (v1)
Topic: Create Send-To-Compressed (zipped)-folder event shortcut (or AutoHotKey Shortcut) on Windows 10
Replies: 21
Views: 3826

Re: Create Send-To-Compressed (zipped)-folder event shortcut (or AutoHotKey Shortcut) on Windows 10

There is a native way to zip files in AHK That's pretty nice. I didn't know about that. it's kind of a chore to make sure to "OK" it or "Enter" it to make it keep going. Sorry, you can remove that msgbox by deleting the "msgbox" line inside the function. I just included it to give some indication o...
by WatsonEnterprises
07 Jul 2021, 00:24
Forum: Ask for Help (v1)
Topic: Create Send-To-Compressed (zipped)-folder event shortcut (or AutoHotKey Shortcut) on Windows 10
Replies: 21
Views: 3826

Re: Create Send-To-Compressed (zipped)-folder event shortcut (or AutoHotKey Shortcut) on Windows 10

highseas wrote:
05 Jul 2021, 01:36
I don't want one giant zip of this 10 GB... no, I needs one zip of each jpg and pdf
That's what my solution does. It searches every subfolder recursively, and if it finds a jpg/pdf pair with the same name, it makes a new zip containing just that pair.
by WatsonEnterprises
04 Jul 2021, 15:21
Forum: Ask for Help (v1)
Topic: Create Send-To-Compressed (zipped)-folder event shortcut (or AutoHotKey Shortcut) on Windows 10
Replies: 21
Views: 3826

Re: Create Send-To-Compressed (zipped)-folder event shortcut (or AutoHotKey Shortcut) on Windows 10

You could do them all at once instead of manually selecting each one, by looping through all your files/folders and sending them to 7zip/Winrar/whatever. https://www.autohotkey.com/docs/commands/LoopFile.htm This will do what you want using 7zip commandline. Pass your parent folder to the function (...
by WatsonEnterprises
31 May 2021, 17:16
Forum: Ask for Help (v1)
Topic: Deleting menu items when a Process Name is detected. Topic is solved
Replies: 2
Views: 232

Re: Deleting menu items when a Process Name is detected. Topic is solved

In your script, the menu is only built once (at the top of the script) and it never changes. If you want the items to change, you need to check the process name and add/delete items accordingly every time before showing it. (That, and you're missing quotes for string comparison against "Explorer.EXE...
by WatsonEnterprises
29 May 2021, 14:14
Forum: Ask for Help (v1)
Topic: Is it possible to increase the "Make everything bigger" setting in windows through AHK?
Replies: 1
Views: 184

Re: Is it possible to increase the "Make everything bigger" setting in windows through AHK?

If you search DPI scaling on the forum, you'll find some threads about it. This thread sets DPI scaling with a hotkey. https://www.autohotkey.com/boards/viewtopic.php?style=17&p=349429 "Make everything bigger" seems to be an Ease of Access feature though, so I'm not sure if it's the same thing as DP...
by WatsonEnterprises
27 May 2021, 00:09
Forum: Ask for Help (v1)
Topic: How to make a picture's transparent background not visible when layered on a parent window?
Replies: 8
Views: 541

Re: How to make a picture's transparent background not visible when layered on a parent window?

What happens if you switch the order around like this? (show gui -> set transparency -> attach to parent) gui, color, white gui, add, picture, h-1 BackgroundTrans, Sun.png winget, ID, ID, Trees0 gui, -Caption -border +hwndGuiID gui, show winset, TransColor, white, ahk_id %GuiID% gui, +parent%ID% ret...
by WatsonEnterprises
26 May 2021, 14:02
Forum: Ask for Help (v1)
Topic: Switch/Case statement help Topic is solved
Replies: 6
Views: 490

Re: Switch/Case statement help Topic is solved

Switch is meant for checking exact values. You probably want a sequence of if/elseifs, or a ternary operator, since it gives you more freedom for what you want to check. var := "all ok" InStr(var, "ok") ? SomeCommand("a") : (var > 7 && var < 10) ? SomeCommand("b") : (var = "an exact phrase") ? SomeC...
by WatsonEnterprises
26 May 2021, 13:40
Forum: Tutorials (v1)
Topic: GuiButtons to use the same "function"/gLabel. Store values within the buttons and use the same gLabel
Replies: 2
Views: 3571

Re: GuiButtons to use the same "function"/gLabel. Store values within the buttons and use the same gLabel

That's kind of clever, I hadn't thought of that. But AHK does support sending parameters to a glabel without smuggling them inside the variable's name. You can assign a bound function object to the buttons using GuiControl +g. Adds a few lines, but makes your intent more obvious. #SingleInstance For...
by WatsonEnterprises
22 May 2021, 03:06
Forum: Ask for Help (v1)
Topic: Question about popup menu
Replies: 3
Views: 602

Re: Question about popup menu

Instead of using ahk's Menu, you could design a custom GUI that resembles a menu. Unlike a menu, your script hotkeys would still respond while your GUI is open. Or, you could run the menu as a separate script. Hotkeys from your main script will still respond, since it's not the one showing the menu....
by WatsonEnterprises
04 Mar 2021, 17:46
Forum: Ask for Help (v1)
Topic: Loops get stuck ~5% of the time?
Replies: 12
Views: 1315

Re: Loops get stuck ~5% of the time?

Does this work?

Code: Select all

~*LButton::
*x::
F1::
	LeftMouse()
return

LeftMouse(){
	keyThatWasPressed := RegexReplace(A_ThisHotkey, "\*|~|\!|\^|\+|\$")
	
	while (GetKeystate(keyThatWasPressed, "P")){
		Click
		sleep 50
	}
}
by WatsonEnterprises
28 Feb 2021, 18:54
Forum: Ask for Help (v1)
Topic: Working with network folders that share the same name Topic is solved
Replies: 9
Views: 476

Re: Working with network folders that share the same name Topic is solved

You want to distinguish between two explorer windows both titled "Downloads", but they have different paths? (F:\Downloads vs \\NetworkSomething\Downloads?). It's possible to get the explorer path from their HWNDs/windowIDs, which would let you tell them apart. Then use WinActivate on "ahk_id someID...
by WatsonEnterprises
01 Feb 2021, 16:05
Forum: Ask for Help (v1)
Topic: logical not in WinTitle parameter
Replies: 3
Views: 1208

Re: logical not in WinTitle parameter

In this case, you could use WinActive's ExcludeTitle parameter. ;WinTitle = "ahk_class OpusApp", ExcludeTitle = "Dokument1 - Word" #If (WinActive("ahk_class OpusApp", , "Dokument1 - Word")) F5::msgbox hi #If You could also accomplish it using ahk_group, since GroupAdd supports ExcludeTitle. GroupAdd...
by WatsonEnterprises
13 Jan 2021, 20:46
Forum: Ask for Help (v1)
Topic: Variable hiding under a rock Topic is solved
Replies: 4
Views: 319

Re: Variable hiding under a rock Topic is solved

https://www.autohotkey.com/docs/Functions.htm#Local https://www.autohotkey.com/docs/Objects.htm#Reference_Counting my_var's scope is just considered local to your function "Function" (assuming it isn't a global variable you declared eslsewhere). In a language like Java, variables declared inside an ...
by WatsonEnterprises
13 Jan 2021, 20:11
Forum: Ask for Help (v1)
Topic: How to write the script with a variable class?
Replies: 4
Views: 450

Re: How to write the script with a variable class?

The part "JUCE_176f9" is always the same. That's what's after that, that change. "RegEx also applies to ahk_class and ahk_exe; for example, ahk_class IEFrame searches for any window whose class name contains IEFrame anywhere." You've already added "SetTitleMatchMode, RegEx", which should accomplish...
by WatsonEnterprises
25 Dec 2020, 12:13
Forum: Ask for Help (v1)
Topic: A script to detect when a window opens
Replies: 3
Views: 301

Re: A script to detect when a window opens

You could do something like this. If you search RegisterShellHookWindow or RegisterWindowMessage on the forum, there are some better examples. #Persistent MyShellMessageListener.Register() return class MyShellMessageListener extends ShellMessageListener{ OnShellMessageWindowCreated(wParam, lParam){ ...
by WatsonEnterprises
09 Sep 2020, 04:24
Forum: Ask for Help (v1)
Topic: "winclose" not working in Windows 10?
Replies: 4
Views: 2544

Re: "winclose" not working in Windows 10?

I had this same problem of WinClose not working on Windows 10, when it had previously worked on Windows 7. (The PostMessage method above worked when WinClose did not.) I was able to fix the problem by right-clicking AutoHotkey.exe in explorer > Properties > Compatibility tab > put checkmark in "Run ...
by WatsonEnterprises
07 Sep 2020, 21:20
Forum: Ask for Help (v1)
Topic: String manip on built-in variables with #include Topic is solved
Replies: 2
Views: 250

String manip on built-in variables with #include Topic is solved

I have a script named "ThisScriptShouldIncludeJoe.ahk". I want this script to #include a script named "Joe.ahk". I want it to rely on a built-in variable, so other scripts can reuse the same logic. (ThisScriptShouldIncludeSteve.ahk, ThisScriptShouldIncludeMike.ahk) The code below expresses the kind ...
by WatsonEnterprises
25 May 2020, 23:18
Forum: Scripts and Functions (v1)
Topic: Toolbars for 'Windows Explorer', for 'Open/Save As' dialogs. Double-click on windows' title bar
Replies: 4
Views: 4462

Re: Toolbars for 'Windows Explorer', for 'Open/Save As' dialogs. Double-click on windows' title bar

This is a really cool program, and I had a lot of fun picking it apart and seeing how it works. I found an "Invalid or nonexistent owner or parent window" error will occur if you open a new CabinetWClass window and then close that window extremely quickly. (For example, a folder on the desktop or so...

Go to advanced search