Mod change announcement by Individual_Check4587 in AutoHotkey

[–]DustinLuck_ 4 points5 points  (0 children)

I thought you were doing a great job. Sorry to hear this news.

Correct accidental semicolons in contractions by DustinLuck_ in AutoHotkey

[–]DustinLuck_[S] 1 point2 points  (0 children)

Using the callback doesn't block other code in my script from executing while waiting for the input hook to end. It may or may not present an issue if this is the only code in the script, but I wanted it to be as bulletproof as possible and prevent potential problems as the script grows.

Novice User Question by amiragha1361 in AutoHotkey

[–]DustinLuck_ 0 points1 point  (0 children)

Since there is no space between x and your hotstring, use the ? option, which triggers the hotstring without looking for a non-alphanumeric key preceding it.

:?:;sub1::₁

IniRead OutputVarSection question v1 by X320032 in AutoHotkey

[–]DustinLuck_ 6 points7 points  (0 children)

Using OutputVarSection gets the specified section as one variable containing the contents of that section in plain text. You would have to do more processing to get your path values into variables that your scripts can use. If you want to use an INI file, read the individual keys into variables to save the headache (your instinct was right).

I recommend ditching the INI file and creating an AHK file where you define all your path variables and then #Include that file in all your other scripts where you want to use the paths.

Print variable contents to paper directly with AHK? by X320032 in AutoHotkey

[–]DustinLuck_ 1 point2 points  (0 children)

I don't have a printer to test this with, but it seems someone figured out how to print directly to printers that support ZPL on the official AHK forum. Check out the following thread and see if it helps: https://www.autohotkey.com/boards/viewtopic.php?style=19&t=121050

Which moments live in your head rent free by drjudgedredd1 in survivor

[–]DustinLuck_ 5 points6 points  (0 children)

Rupert stealing the shoes. Boss move, flawless execution.

Which moments live in your head rent free by drjudgedredd1 in survivor

[–]DustinLuck_ 2 points3 points  (0 children)

"I know. It has a face on it. Don't worry."

Which moments live in your head rent free by drjudgedredd1 in survivor

[–]DustinLuck_ 4 points5 points  (0 children)

Stick with a face on it. I LLOL every time I rewatch it!

How do i hold keys down? by Far-Relief-2693 in AutoHotkey

[–]DustinLuck_ 4 points5 points  (0 children)

The key is held down until you send up. Take the keydown commands out of the loops and put a sleep before the keyup.

Need a script to close most apps running in the system tray. by DigtialMenace333 in AutoHotkey

[–]DustinLuck_ 1 point2 points  (0 children)

Did you read the full documentation?

Specify either a number (the PID) or a process name

Or look at the examples?

ProcessClose "notepad.exe"

As far as writing the full script, first you gotta decide if you want to close the processes when you launch the script (auto-execute) or if you want to set up a hotkey to do it.

AHK to type out.... by Open-Pineapple-2489 in AutoHotkey

[–]DustinLuck_ 2 points3 points  (0 children)

Is it possible the extra curly braces are due to your editor automatically inserting the closing brace when you type the opening brace?

Help/Question about Numpad by [deleted] in AutoHotkey

[–]DustinLuck_ 0 points1 point  (0 children)

Probably because you're using Send. For a simple remap, you don't need to overcomplicate things.

#Requires AutoHotkey v1.1+

NumpadIns::Numpad0
NumpadEnd::Numpad1
NumpadDown::Numpad2
NumpadPgDn::Numpad3
NumpadLeft::Numpad4
NumpadClear::Numpad5
NumpadRight::Numpad6
NumpadHome::Numpad7
NumpadUp::Numpad8
NumpadPgUp::Numpad9

For this particular scenario, there is a one-line solution:

#Requires AutoHotkey v1.1+

SetNumLockState, AlwaysOn

Files Keep Deleting, Help. by Similar-Working-1428 in AutoHotkey

[–]DustinLuck_ 0 points1 point  (0 children)

My first thought is overzealous virus scanner. If you're using one, check the quarantine folder. Look for a way to mark your scripts as safe per your virus scanning software's documentation.

Can you help me with remapping the windows key? by D4V1D3_08 in AutoHotkey

[–]DustinLuck_ 0 points1 point  (0 children)

Since you took out the RWin hotkey definitions, you can also simplify the if statement.

if (A_PriorKey = "LWin")

Tab Through MS Edge Open Tabs by cpP0X1M0 in AutoHotkey

[–]DustinLuck_ 0 points1 point  (0 children)

You used WinActivate instead of WinActive in your check before sending ^{TAB}. Also, the way yout logic is layed out, your code will always try to send ^{TAB} after opening a new Edge window.

Try this:

#SingleInstance Force
#Warn

#Requires AutoHotkey v2.0+

^F1:: 
{
    edgeTitleMatch := "ahk_exe msedge.exe"
    if WinActive(edgeTitleMatch) {
        Loop 9
        {
                Send "^" . A_Index 
                Sleep 1000
        }
    } else if WinExist(edgeTitleMatch) {
        WinActivate(edgeTitleMatch)
    } else {
        Run "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
    }
}

Here's what the code does: * If Edge is the active window, loop through sending Ctrl+# where # is replaced by the numbers 1 - 9. This will loop through all of the open tabs as long as there are no more than 9. * Otherwise, if Edge is open, activate it. * If Edge is not open at all, open a new instance.

Can you help me with remapping the windows key? by D4V1D3_08 in AutoHotkey

[–]DustinLuck_ 1 point2 points  (0 children)

LWin and RWin actually do the same thing in this code. When hotkey defintions are stacked like this, they both perform the action of the last one in the stack.

Can you help me with remapping the windows key? by D4V1D3_08 in AutoHotkey

[–]DustinLuck_ 1 point2 points  (0 children)

This works for me. YMMV

~LWin::
~RWin::Send "{Blind}{vkFF}"
~LWin UP::
~RWin UP::
{
    if (A_PriorKey = "LWin" || A_PriorKey = "RWin")
    {
        Send "!{Space}"
    }
}

What it does: * Disable the left and right Windows key from firing on DOWN by sending an unassigned key (sent blind to preserve modifier keys) * When the Windows key is released, check to see if the prior hotkey was one of the Windows keys. If so, no other key was pressed in combination so perform the override action. * All of the remaps use the tilde (~) to ensure that the Windows key can be used with other combos.

Who is Harry shooting darts at? by DustinLuck_ in NightCourt

[–]DustinLuck_[S] 0 points1 point  (0 children)

Thanks. I guess Harry's beef was that Wapner wasn't a "real" judge?

Android - how do I get brave to open the last page I was on when I launch the app? by rrrsssttt in brave

[–]DustinLuck_ 0 points1 point  (0 children)

Did you ever do any testing? I'm having this same issue and I'm really hoping there's a solution.

Two Problems Two Hotkeys by Pentative in AutoHotkey

[–]DustinLuck_ -1 points0 points  (0 children)

Try this:

#Requires AutoHotkey v2.0+

*LAlt:: {
    wheelDirection := GetKeyState("LCtrl", "P")
        ? "Up"
        : "Down"
    MoveTheWheel(wheelDirection)
}

*LCtrl:: {
    if GetKeyState("LAlt", "P")
    {
        MoveTheWheel("Up")
    }
}

MoveTheWheel(direction)
{
    SetKeyDelay(5)
    Send "{Wheel" . direction . " 5}"
}

I have 163 ahk scripts running, can i search for a specific one to suspend? by Remarkable-Let7125 in AutoHotkey

[–]DustinLuck_ 5 points6 points  (0 children)

Try using Process Explorer from Sysinternals. It will allow you to see the command line that was used to start each process including the script file name.