Live data from Hacker News

Learning to code vs. learning to automate

daedtech.com

111–120 of 190 posts

Re: Learning to code vs. learning to automate

#111
post #78

If you're on Windows, Auto HotKey is the ultimate tool for automating day to day little things that are hyper specific for your daily work flow. For everything else there's Bash / some scripting language. You can end up with really big quality of life improvements from having a bunch of little things whipped up to solve your problems.

Can Auto HotKey recognize images and click on them? For example, a specific button in an app or a web page? This is one of the features that keeps me with Keyboards maestro, which keeps me from switching away from macOS.

I'm not an AHK wizard but to my understanding, the answer is "yes" to almost every "but can it do...?" questions.

In your case, from my limited understanding it would be no problem to identify a specific button in an app and then interact with it because you would be hooking into the app's low level window title / class / handles.

AHK comes with a "spy" tool where you can just move your mouse around and it gives you low level details about every window, and then you can write AHK scripts that interact with those things.

The script would look something like:

    ControlClick, OK, "My Cool App"
That would click the OK button in a window that has a title of "My Cool App". If you Google around for "auto hotkey, click button in app" you'll find a ton of examples.

Re: Learning to code vs. learning to automate

#112
I have automated some things both at work and at home. Sometimes the "time saved doing the thing vs time spent setting it up" calculation looks very shaky, but I persist because when I'm puzzling out how to automate something I'm learning and adding to my skillset that may be useful for the next thing (and is therefore inherently interesting, may lead to greater efficiencies, etc). If I'm just spinning my wheels clicking arbitrary buttons I'm not really learning anything (and I guess in stark economic terms, not adding value to myself as an employee).

DISCLAIMER: I'm not in such a high-paid position that spending an hour or two down a rabbit hole feels like I'm wasting serious time/money.

Re: Learning to code vs. learning to automate

#113
post #111

Earlier quoted context omitted.

Can Auto HotKey recognize images and click on them? For example, a specific button in an app or a web page? This is one of the features that keeps me with Keyboards maestro, which keeps me from switching away from macOS.

I'm not an AHK wizard but to my understanding, the answer is "yes" to almost every "but can it do...?" questions. In your case, from my limited understanding it would be no problem to identify a specific button in an app and then interact with it because you would be hooking into the app's low level window title / class / handles. AHK comes with a "spy" tool where you can just move your mouse around and it gives you…

I have limited experience with Keyboard Maestro but I do have some with AppleScript. It lets you do as you described, get windows, titles, UI elements. However this only works on native apps, you cant, for example, click a button on a webpage with a CSS selector or by scanning pixels of the window, ad far as I know. Can AHK do that? That would be super useful

Re: Learning to code vs. learning to automate

#115
post #78

If you're on Windows, Auto HotKey is the ultimate tool for automating day to day little things that are hyper specific for your daily work flow. For everything else there's Bash / some scripting language. You can end up with really big quality of life improvements from having a bunch of little things whipped up to solve your problems.

AutoHotkey is an ugly language to write in, but oh boy is it useful for gluing disparate Windows actions together.

Theoretically you can do the same thing that AHK does in a .net language or even Powershell but AHK is just easier to whip up something very quickly.

Still I wish there were better Python wrappers for Windows automation.

Re: Learning to code vs. learning to automate

#116
post #113
post #111

Earlier quoted context omitted.

I'm not an AHK wizard but to my understanding, the answer is "yes" to almost every "but can it do...?" questions. In your case, from my limited understanding it would be no problem to identify a specific button in an app and then interact with it because you would be hooking into the app's low level window title / class / handles. AHK comes with a "spy" tool where you can just move your mouse around and it gives you…

I have limited experience with Keyboard Maestro but I do have some with AppleScript. It lets you do as you described, get windows, titles, UI elements. However this only works on native apps, you cant, for example, click a button on a webpage with a CSS selector or by scanning pixels of the window, ad far as I know. Can AHK do that? That would be super useful

Yes, Autohotkey can search for pixels and stuff:

https://www.autohotkey.com/docs/commands/PixelSearch.htm

Re: Learning to code vs. learning to automate

#117
post #79

The problem often isn't ability to automate. It's that the workers closest to the problem have an overwhelming disincentive to automate. Suppose I have a low-level job in Peloton operations. Our Phalange Team must ensure that, before a bike's in-home delivery date is confirmed, the delivery technician has placed an internal order for a left phalange. Each of us spends all day navigating between the Sales app and the…

I worked at a place where coding was not my job (it was technical support) but I wrote some scripts that automated some stuff. It was handy and everyone liked it. Then someone in the process changed things that the scripts did not understand. Management came running to me upset that this thing I automated didn't work. Being technical support managers most didn't understand (not all but most) that when you change thin…

I can attest to this. I had similar experiences when I was in Aerospace. The complete incompetence of management is staggering and the mentality to stick with what has worked keeps efficiencies down. They instead went after the workers to "work harder" instead of allocating time and money to automation. I finally left and went to work on automation for industries that were receptive to creating tools that would make them more efficient. It's exceptionally frustrating to be in such a position, and you are right, it's better to do nothing and find yourself a place that fully understands what it means to save time and money by spending a fraction of it to fix while putting functioning processes in place to mitigate the risk of someone changing anything without going through the proper channels to ensure that the tools continue to work.

Re: Learning to code vs. learning to automate

#118
post #113
post #111

Earlier quoted context omitted.

I'm not an AHK wizard but to my understanding, the answer is "yes" to almost every "but can it do...?" questions. In your case, from my limited understanding it would be no problem to identify a specific button in an app and then interact with it because you would be hooking into the app's low level window title / class / handles. AHK comes with a "spy" tool where you can just move your mouse around and it gives you…

I have limited experience with Keyboard Maestro but I do have some with AppleScript. It lets you do as you described, get windows, titles, UI elements. However this only works on native apps, you cant, for example, click a button on a webpage with a CSS selector or by scanning pixels of the window, ad far as I know. Can AHK do that? That would be super useful

While I've never done it, AHK seems to have an API for being able to interact with DOM elements.

Check the marked answer here: https://stackoverflow.com/questions/49516638/ahk-web-element...

The above answer shows both navigating to a new page that isn't open yet or interacting with an already loaded page based on the title of the tab.

Re: Learning to code vs. learning to automate

#119
post #115
post #78

If you're on Windows, Auto HotKey is the ultimate tool for automating day to day little things that are hyper specific for your daily work flow. For everything else there's Bash / some scripting language. You can end up with really big quality of life improvements from having a bunch of little things whipped up to solve your problems.

AutoHotkey is an ugly language to write in, but oh boy is it useful for gluing disparate Windows actions together. Theoretically you can do the same thing that AHK does in a .net language or even Powershell but AHK is just easier to whip up something very quickly. Still I wish there were better Python wrappers for Windows automation.

> Theoretically you can do the same thing that AHK does in a .net language or even Powershell but AHK is just easier to whip up something very quickly.

This is exactly how I see it too. 10+ years ago I would have written a C# app to do something that I can now do in AHK.

Of course there's limitations (I wouldn't write a super intensive native app in AHK) but for little workflow optimizations it's so good.

For example, I wanted a quick and dirty way to grab the hex color under my mouse cursor and copy it to my clipboard. With AHK it was:

    #h::
    MouseGetPos, MouseX, MouseY
    PixelGetColor, color, %MouseX%, %MouseY%
    StringLower, color, color
    clipboard := SubStr(color, 3)
And now when I press Windows + h as a global hotkey it does what I want. I set it up to start when Windows starts and it uses 1.5MB of memory. Can't really beat that for overall efficiency (few minutes of coding, doesn't take up much resources, etc.).

A while back I wrote a blog post on using AHK for defining global hotkeys. I still use that method today. If anyone cares, that's at: https://nickjanetakis.com/blog/remap-and-set-global-hotkeys-...

Re: Learning to code vs. learning to automate

#120

When I was younger I dreamed up an idea of a shock suit, basically it would have been a set of long underwear top and bottom with electrodes that would act like a TENS machine to gently(or not so gently) nudge the wearers into performing a repetitive task with machine accuracy. I figured this would be great for an assembly line and could provide a cheaper alternative to a very costly robot while still providing emplo…

Continuum had something like this. If you owed too much, they would implant the ship right into your spine and it would take full control of your body until your death (since it was impossible for you to pay off the amount).
Post reply on HN