Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Intro and general natter


  • Please log in to reply
No replies to this topic
ahketype
  • Members
  • 15 posts
  • Last active: Nov 22 2018 01:22 AM
  • Joined: 11 Nov 2010
Hello people. I've been messing with Autohotkey for a year or so now, and I'm just starting to do some more complex stuff with it. I'll be searching for answers and posting a question or two elsewhere, but I thought I'd introduce myself and give a bit of general feedback.

I've been looking for a simple language I can use to write reasonably good looking and stable programs, partly just for myself, but with an eye to possible distribution and even sales. I'm not sure AHK is it, but it's better than what I was using (in a lot of important ways), and each time I try a new language I learn more about programming and the Windows API.

I was using Gui4Cli - and still am - and it is utterly amazing in some ways, but I've found it rather clunky in parts and fairly buggy. Most serious of all, it's being developed by just one guy, which means his inbox is full of requests and he's got a to-do list as long as your arm. (I've just realised, I don't know who writes AHK.)

What's great about G4C is the "height" of the high-level language, so that you can create controls with a few lines, and the triggered code for each control - the equivalent of its g-label subroutine - you just write straight underneath. It considers a blank line the end of that code. Most of the syntax for general control is a breeze, without curly braces and all that tat (I've always had a thing about curly braces round lines of code!), but the variable handling is a bit odd and the math is pretty weak. For putting actual GUIs together it's the bees knees, but AHK knocks spots off it in many areas.

I was just using AHK for hotkeys and such for some time, but then I wanted a specific program, which is almost impossible to find anywhere online, a simple, personal keylogger not for spying, but just to back up things I type - I mean there are loads online, but they're usually for spying so they have useless stuff and many have to be opted out in your antivirus, and I just never quite find the features I'm looking for. Gui4Cli can't do it, because its key recognition isn't system wide, just within a GUI window. So that's one thing I'm doing at the moment. Well, I have done it, except I decided to add a feature to backup text in full from any window (as keylogging messes up the text when you delete, move the caret, change window, etc.)...and that bit has been quite a learning curve.

Some things I don't feel happy with as yet in AHK are the odd syntax, with multiple methods of assignment depending on circumstance, curly braces round if-conditions and so on, which just seem like a waste of space (all that's required is If...Else...EndIf), and the complexity of comma-delimited statements where sometimes commas are requried and have to be counted...and the smart-comma in MsgBox seems to cause problems. I haven't found any RichEdit control, and miss it, as well as a range of quick, easy commands for operating on listviews and treeviews and lots of other controls that Gui4Cli has.

Before Gui4Cli, like a decade ago, I used MacroAngel - does anyone remember that? I don't know if there's anything like it now. MacroAngel was such a good program, apart from a few bugs! It wrote macros, obviously, but did it with specific forms for each type of action instead of a script language, so you just filled in or browsed or selected the details for each step, and the program built up the script file behind the scenes. Again, a one-man show, and at some point he stopped working on it. I have vague notions of reproducing something like that myself when I find the right language and learn a lot more.

Even more decades ago, I was pretty darn good with BBC BASIC and 6502 Assembly language, and wrote some neat programs on my 8k RAM Acorn Electron. I saved up and got the cutting-edge technology of the Plus3 add-on with a 3.5 inch floppy disk drive!

My next language foray is probably going to be BBC for Windows, which is at a lower level - I think almost everything controlling the machine has to be done with dll calls - but the syntax is very familiar. I might get sick of it pretty quick, or it might force me to understand the API more and be just what I need.

One minor gripe about AHK is that the help isn't always as clear as it might be, particularly regarding the difference between a variable and literal text. For instance, under Menu there is
ToggleCheck, MenuItemName
A simple convention would help the new user to distinguish a keyword, ToggleCheck from the variable name, MenuItemName, like maybe <MenuItemName>, or all lowercase, or italics or another font. OK, it's got the word 'Name' in there, and other examples are ColorValue and ClickCount, which suggest that they're variable names made up for the user guide, but it's not immediately obvious, and it would help me to learn the keywords if they were clearly different from other text. On the whole, it's a very good manual, and I've hardly found an error yet in terms of actual applicability and accuracy.

I keep starting to read the Python manual, but while I learn a lot about how clever it is with its lists and collections and slices and banana fruitcakes, everything being an object or whatnot, I never find where you start learning how to actually do useful stuff with it!