Friday 26 August 2022

Directives vs Commands in AHK/AutoHotKey

I couldn't find a direct answer to this question, so thought, once I'd managed to piece it together I'd post it here for any future searchers.

In general programming a command is a specific type of directive which tells a programme to do a particular task. However, AHK plays by its own rules. 

According to Frankie Bagnardi, in AHK "Directives are processed just before the script starts and allow you to customize AutoHotkey’s behaviour". There are two types. The first is just the bits of code at the top of a script, but they are also anything that starts with a #.

So in AHK directives are the bits of code starting with a # (hashtag/pound sign in the US)

So if you use, say, #IfWinActive partway down your code, the the commands that follow it will be specific to that context, until you turn it off (by using the same directive, with no conditions/parameters afterwards).

Directives are a type of commands which use a # to create a context. Bits of code that aren't functions, expressions, variables, parameters, text etc. are all commands, (e.g. Send, Sleep, Run, MsgBox). Directives are a specific subset of the available commands.

And, for the sake of completion, functions are those bits of code that come with brackets(parentheses). Expressions are bits of maths.

- If I've got this wrong, please let me know in the comments without shouting or calling me an idiot...

Saturday 20 August 2022

iPad Native Keyboard Shortcuts


I've had an iPad for over a decade and always found it's keyboard, particularly the lack of backwards and forwards keys, frustrating. Recently however I got a new model and, quite by accident I discovered a useful shortcut that when I Googled, no-one else seems to have picked up on (or all the people who have are buried below the usual pile of SEO-d crap).

Anyway if you click the "I" key and then the "O" key in quick succession it selects the word the cursor is on or after. 

IO, just like like that!

In other words I-O (I+O?) is like double clicking with a mouse. It's a minor thing but gets me wondering what other hidden combos there are.

I set off trying to find out and then discovered that Apple have, in fact, done something closer to left and right arrow buttons. If you press and hold the space bar the markings blank out and you can then use the keyboard as a track pack. I got that thanks to this video by Steve Katz.

Does anyone know of any others?

Wednesday 3 August 2022

How to get an editable list of all the files in a folder from Windows Explorer

Often you have a lot of files in a folder and for some reason you want to paste them in Word, Excel, Notepad or something else, but a straight select all, copy & paste doesn't work. While solutions exist for that online using the registry editor, they sound a bit foreboding or complicated, or your IT won't et you have permission. 

Here's an easier way: Copy the folder path from the bar in Windows Explorer (e.g. C:/Users/your.name/Documents) and drop it in to the URL bar in MS Edge or Chrome. Et voila! You can then copy and paste the text wherever you want.

If this doesn't work either check you've used "/"s and not "\"s. Secondly try using a different folder and navigating your way there through the folders in Chrome/Edge.