Pulover's 2 problems: Can't cancel a dialouge box Thru Pulover commands, and Duplicate Hotkeys error.

Advanced Macro Recorder/Editor.

Moderator: Pulover

Bathinda
Posts: 13
Joined: 01 Jan 2023, 05:29
Contact:

Pulover's 2 problems: Can't cancel a dialouge box Thru Pulover commands, and Duplicate Hotkeys error.

Post by Bathinda » 01 Jan 2023, 05:59

1. Can't we create a macro command to click the 'ok/cancel' button of a msg box which itself has been produced by the PMC macro? In other words, suppose the first line of a macro in PMC is set to produce a simple msg box with 2 buttons, 'cancel' and 'ok'. And the next line of command is a simple 'Escape' (or 'Enter') key press. And then, to use yet another method, the 3rd line is a command line to click the same ok/cancel button (whether thru giving it mouse coordinates or by telling the 'control' name, or both). But no way succeeds in clicking any of the 2 buttons on that msg box. Although if the same msg had been produced by any other window than PMC, then I'm easily able to click any button I wish thru PMC commands. Also the same method is able to click any desired button of any dialogue box/window which has been invoked by any other program than PMC itself.

2. In the PMC interface, even on a macro which has just one command line to produce a msg, when I click on the 'Play' button (which is 2nd button on that toolbar, first being the red 'Record' button), then an error is produced: "Duplicate Hotkeys" and no execution of code takes place. But if I click the next 'Play' button, which is 3rd from left on the same toolbar, or if I click the 'Play' button on the 'Control Toolbar', then no error is produced and macro lines are executed correctly. What may cause this error?

User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: Pulover's 2 problems: Can't cancel a dialouge box Thru Pulover commands, and Duplicate Hotkeys error.

Post by boiler » 01 Jan 2023, 08:21

I am not a PMC user, but regarding part 1, there is a way to do this in native AHK, so I would think that it would be possible to do it in PMC as well. I’m not seeing the value in displaying a MsgBox if it is automatically going to be dismissed by the script itself. What purpose does that serve?

Bathinda
Posts: 13
Joined: 01 Jan 2023, 05:29
Contact:

Re: Pulover's 2 problems: Can't cancel a dialouge box Thru Pulover commands, and Duplicate Hotkeys error.

Post by Bathinda » 23 Mar 2023, 00:44

Purpose was to produce a msg by the ahk macro, and wished that that msg dialogue box went away without doing anything actively by the user.

Anyway, it was not something big. I moved on some other way. Thanks again.

But if you knew what may be causing this, I'd be obliged.

User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: Pulover's 2 problems: Can't cancel a dialouge box Thru Pulover commands, and Duplicate Hotkeys error.

Post by boiler » 23 Mar 2023, 02:15

Nothing is causing it except the standard way MsgBoxes work. The code after the MsgBox doesn’t even execute until the MsgBox is dismissed. So the reason any clicks you are trying to perform after displaying the MsgBox don’t work is that they are not even executed until the MsgBox is no longer there. This is on purpose so that the script waits for the user’s action before proceeding.

One of the parameters of a MsgBox in AHK is “Timeout”, which lets you define how many seconds to wait before the MsgBox dismisses itself. I would hope PMC also lets you define the Timeout for a MsgBox, but I don’t know any details about PMC.

Bathinda
Posts: 13
Joined: 01 Jan 2023, 05:29
Contact:

Re: Pulover's 2 problems: Can't cancel a dialouge box Thru Pulover commands, and Duplicate Hotkeys error.

Post by Bathinda » 01 Apr 2023, 03:02

Good.
You caught it.

Can you pls tell (perhaps with some example) the 'Timeout' syntax? Because I couldn't find any option to define 'timeout' in Pmc.

User avatar
boiler
Posts: 16902
Joined: 21 Dec 2014, 02:44

Re: Pulover's 2 problems: Can't cancel a dialouge box Thru Pulover commands, and Duplicate Hotkeys error.

Post by boiler » 01 Apr 2023, 06:16

This is an example in native AHK (v1, which PMC was built around). Again, I don’t know anything about how PMC implements it or whether it provides the opportunity to insert native AHK code.

Code: Select all

MsgBox,, Notice!, This message will self-destruct in 3 seconds., 3
The reason for the consecutive commas is that it is skipping the first parameter (Options) that would appear between them. It creates a MsgBox with the title “Notice!” and the message shown in the body, and it will last for 3 seconds if not dismissed by the user before then.


Post Reply

Return to “Pulovers Macro Creator”