What is this function in PMC

Advanced Macro Recorder/Editor.

Moderator: Pulover

kotsnirvana
Posts: 3
Joined: 18 Jan 2017, 22:33

What is this function in PMC

Post by kotsnirvana » 25 Mar 2024, 06:30

Good evening I have found the following line of code in one of the autohotkey forums and I want to ask the following 2 questions.

Code: Select all

:*:AB ::
Send, ABCDEF
This particular code when I press on my keyboard, "AB(+SPACE)" sends the word ABCDEF.

1. I want to make the above code from pullover's macro creator. With which FUNCTION (BUTTON), will I be able to get that particular line of code, because no matter how much I searched the ui I couldn't find the relevant option.

Can someone give me detailed instructions?

2. At the beginning of the code there is an asterisk, can someone explain to me why there is this asterisk, it is exactly its job because when I delete it the code finds an error?

User avatar
gregster
Posts: 9224
Joined: 30 Sep 2013, 06:48

Re: What is this function in PMC

Post by gregster » 25 Mar 2024, 07:32

I have no knowledge whatsoever about PMC, but in AHK your code above would constitute a hotstring subroutine. I would look for this term in PMC as well. (The multi-line subroutine above would miss a closing return, though, with potential unwanted side-effects in a larger script. Instead of a return, you could create an one-line auto-replace hotstring: :*:AB ::ABCDEF with implicit Send and Return.)

The asterisk is completely optional and its removal would not cause an error in AHK. It just modifies the hotstring's behaviour:
https://www.autohotkey.com/docs/v1/Hotstrings.htm#Options wrote:* (asterisk): An ending character (e.g. Space, ., or Enter) is not required to trigger the hotstring. For example:

Code: Select all

:*:j@::jsmith@somedomain.com
The example above would send its replacement the moment you type the @ character.
This means, if you remove * from your own code, you would need to type a, b, space and additionally another ending character like space, enter or -()[]{}':;"/\,.?!`t (by default) to trigger your hotstring. This also means that ::AB::ABCDEF (without the space) would almost do the same like your code above, but it would also trigger with other ending characters, not just space.

I personally think that learning PMC only complicates matters, as for many things it seems at least as complex as directly using AHK. With the crucial difference that you actually get forum support and a lot of resources for AHK.

kotsnirvana
Posts: 3
Joined: 18 Jan 2017, 22:33

Re: What is this function in PMC

Post by kotsnirvana » 25 Mar 2024, 07:57

1000 thanks for your reply, especially the part where you explain how the modifier * works is very informative.

But because I'm doing a project and I need to show how to import hotstrings with PMC, I please if anyone else knows details please reply

Post Reply

Return to “Pulovers Macro Creator”