Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "autohotkey"
-
The best prank played in our office was an AutoHotkey script that changed the space character to actually print the word 'space' in all caps.
The next message in Hipchat from the victim was: "WhatSPACEtheSPACEfuck!SPACEMySPACEkeyboardSPACEisntSPACEworking!"
The next time this prank was pulled, ALL symbols were typed out in all caps.1 -
Forgive me father, for I have sinned. Alot actually, but I'm here for technical sins. Okay, a particular series of technical sins. Sit your ass back down padre, you signed up for this shit. Where was I? Right, it has been 11429 days since my last confession. May this serve as equal parts rant, confession, and record for the poor SOB who comes after me.
Ended up in a job where everything was done manually or controlled by rickety Access "apps". Many manhours were wasted on sitting and waiting for the main system to spit out a query download so it could be parsed by hand or loaded into one of the aforementioned apps that had a nasty habit of locking up the aged hardware that we were allowed. Updates to the system were done through and awful utility that tended to cut out silently, fail loudly and randomly, or post data horrifically wrong.
Fuck that noise. Floated the idea of automating downloads and uploads to bossman. This is where I learned that the main system had no SQL socket by default, but the vendor managing the system could provide one for an obscene amount of money. There was no buy in from above, not worth the price.
Automated it anyway. Main system had a free form entry field, ostensibly for handwriting SELECT queries. Using Python, AutoHotkey, and glorified copy-pasting, it worked after a fashion. Showed the time saved by not having to do downloads manually. Got us the buy in we needed, bigwigs get negotiating with the vendor, told to start developing something based on some docs from the vendor. Keep the hacky solution running as team loves not having to waste time on downloads.
Found SQLi vulnerability in the above free form query system, brought it up to bossman to bring up the chain. Vulnerability still there months later. Test using it for automated updates. Works and is magnitudes more stable than update utility. Bring it up again and show the time we can save exploiting it. Decision made to use it while it exists, saves more time. Team happier, able to actual develop solutions uninterrupted now. Using Python, AutoHotkey, glorified copy-pasting, and SQLi in the course of day to day business critical work. Ugliest hacky thing I've ever caused to exist.
Flash forward 6 years. Automation system now in heavy use acrossed two companies. Handles all automatic downloads for several departments, 1 million+ discrete updates daily with alot of room for expansion, stuff runs 24/7 on schedule, most former Access apps now gone and written sanely and managed by the automation system. Its on real hardware with real databases and security behind it.
It is still using AutoHotkey, copy-paste, and SQLi to interface with the main system. There never was and never will be a SQL socket. Keep this hellbeast I've spawned chugging along.
I've pointed out how many ways this can all go pearshaped. I've pointed out that one day the vendor will get their shit together they'll come in post system update and nothing will work anymore. I've pointed out the danger in continuing to use the system with such a glaring SQLi vulnerability.
Noone cares. Won't be my problem soon enough.
In no particular order:
Fuck management for not fighting for a good system interface
Fuck the vendor for A) not having a SQL socket and B) leaving the SQLi vulnerability there this long
Fuck me for bringing this thing into existence5 -
Why so much hate for Windows? I can do all the scripting that I do on Linux on Windows as well. AutoHotKey for the win! In fact, the hacks that I can do on Windows directly cannot be done on Linux unless I have the terminal open. I'm still learning, yeah, so I'll learn how to do that in due time, but I've never had any issues with drivers, software issues, or security threats while using Windows.
And Windows Defender is so good now! I don't need an antivirus. Well, good browsing habits and common sense is enough of an antivirus so it's a moot point anyway.
Either way, I like embracing the power of AND. Why choose? I love both Windows and Linux!26 -
So Taran from Linus Tech Tips posted his autohotkey code on twitter the other day and the amount of redirecting and includes is a little frustrating.1
-
Autohotkey.
Is it just me or is AHK a bit braindead?
1. Why invent a worse version of other scripting languages instead of just writing a library..
2. Despite it's high lvl complex syntax it can't even manage multiline things without having 'or' 'and' '||' ',' '.' in front of every line?
Look what I had to do..
options := { image : "../../Resources/OpacitySlider.png"
, from : [ 0 , 0 ]
, to : [ a_screenWidth , a_screenHeight ] }
( commas were aligned with the curly bracket )
3. #Include isn't relative to the current file but relative to the main script?!
What the actual fuck.
Worked around it with:
#Include %A_LineFile%\..\Gdip.ahk
but wtf
( Including library files from other library files )
4. probably more, I just got the thing I was working on to work so I'd rather never touch it again if I can..
5. Profit?6 -
Anyone use AutoHotKeys?
If you do, what are some scripts you use daily?
I also plan to create some of my own scripts and I need suggestions6 -
Do you also learn more using code snippets in the Internet than from sites and wikis trying to explain specific commands?
That's pretty odd in my opinion. -
Copy/Paste to/from multiple clipboards in Windows - https://github.com/Matts/AltCopy
I've always had the issue when refactoring code, I am wanting to "copy on cut", or just having two clipboards to use separately.
I am not sure if anyone has ever had this issue before, and so am also not sure if anyone has ever created a solution it. So I took 10 minutes and made a AutoHotkey script to solve it.6 -
I've already done this week's topic (https://www.devrant.io/rants/703795) but here's my second one.
The Windows wScript API. It's just crappy. The easiest way to use it is to use AutoHotKey, FFS. That's a separate, 3rd party, script language. Not a simplified CLI, not a standardized library. There are both of these things but they barely fit the specification above. Ugh. -
So I've been using Visual Studio and I'm really starting to get pissed off at the key combinations.
Like Ctrl+K+Ctrl+D
Just to auto format code. So I'm now thinking of speeding up my workflow by using AutoHotKey which by the way is the best thing ever invented.
If anyone uses VS and is interested in me sharing the ahk script then let me know. I just feel like pressing 4 keys for simple tasks is just a waste of time and easy to forget.3 -
I just started a new job last week. Old-school sysadmin role for a pretty old-school company, but the pay is nice and the kids've gotta eat.
They gave me a windows laptop. I haven't used windows for work or as a daily driver since 2016, and now, a week into trying to make this machine work for me, I have the following observations to report.
WSL is nice. It's nice to have it installed(though actually installing it was an adventure unto itself), and to set alacritty to open my default user prompt straight into that is very nice. As terminal emulators are by far my most used piece of software, that's nice to have.
Command-line software management through powershell, winget, and chocolatey are also very nice.
I like the accessibility offered by autohotkey, though there is something of a learning curve on it. Once I get better with it, I suspect that what follows will be largely mitigated.
The Bad:
In general, Windows is janky. It feels like it's all kinda taped together without any particular cohesion in mind. As a desktop, it feels decidedly amateur, compared to the feature-mountain polish of MacOS, and especially compared to the flexibility and infinite possibilities of Linux.
Lots of screen real estate is wasted, with window decorations, and fonts that look terrible at smaller sizes, because the antialiasing of fonts is just terrible. Almost all the features I depend on in other desktops: ad-hoc searches and launches(alfred, rofi) are-- again --janky. They work, but they typically require more typing than alfred or rofi. I admit I haven't spent weeks on this problem yet, but I haven't found a workable solution yet with wox, hain, and keypirinha. Quick searches like what you get with alfred, alfred workflows, and the swiss army knife that is rofi, just aren't possible or reliable with the tools I've used so far, and most require some kind of indexing agent to fully function.
It beggars imagination that a desktop in which users are subjected to "default apps" that is purported to be acceptable for enterprise, professional use, does not have a default entry for text editor. I installed nvim-qt, and I want to use it to edit anything and everything I ever edit with text, but all too often, apps have hard-coded instructions to open text files with notepad.
I want to open certain URLs with firefox, certain ones with firefox developer edition, and others with vivaldi, and yet there is not an app available that I have seen yet in my searches that allows me to set this kind of configuration. I found one that's supposed to, but it just ignores everything I put into its config, and just opens MS Edge for everything. Jank.
Simple things take too long. Like the delay between when I laboriously hit ctrl-alt-del to bring up the login and when the actual text field appears, and the delay between that and when I want to start using the computer.
Changing some settings requires a reboot. Updating some software requires a reboot. Updating permissions on something sometimes requires a reboot. And those are all on top of the frequent requests to reboot for updates.
I would have thought Windows would have overcome most of the issues that create these problems, but it's just, as I said, amateur.1 -
I am currently typing this on my windows machine using the workman keymap (I love it).
I am mostly writing in german (still a student) and therefore need the characters "äöüß" quite often.
There comes AutoHotKey into play where I can set e.g. alt+a to ä. works like a charm.
Now I would really love to switch to linux (in fact I have already done so) but as I could not find a suitable alternative to AHK I am stuck without äöüß. Writing is such a pain, My poor professors that have to read the texts I produce on my Linux machine
gotta love it6