MessageBox with Drag&Drop functionality

Advanced Macro Recorder/Editor.

Moderator: Pulover

FilipeMeiraCastro
Posts: 28
Joined: 13 Jul 2014, 16:33

MessageBox with Drag&Drop functionality

Post by FilipeMeiraCastro » 24 Nov 2020, 06:41

In PMC, I was trying to have a filepath to be input as a Drag&Drop.

--> One option would be to add a "MessageBox Drag&Drop functionality" and variable filed to store the value of the drag&drop event.

--> Another option, I have tried to make a dummy application that is just a Drag&Drop canvas that outputs the event to the command line. This works well with batchfiles as I can have a variable being assigned to the DragDrop.exe output. The issue comes, how to insert this variable into PMC. For the RunWait functionality there is no place to assign a variable. (There is something to the errorlevel, but this output would be a string)
User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: MessageBox with Drag&Drop functionality

Post by Pulover » 24 Nov 2020, 15:47

Haven't tested it but you can probably get all command line arguments from A_Args inside a command in PMC.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
FilipeMeiraCastro
Posts: 28
Joined: 13 Jul 2014, 16:33

Re: MessageBox with Drag&Drop functionality

Post by FilipeMeiraCastro » 29 Nov 2020, 04:32

@Pulover Thanks for your reply, I have tried the following but no luck, the %a_args[1]% is not parsed as a variable!

I guess one workaround is for me to have the executable to write the outpout as a TXT file, and then have PMC reading the textfile instead!

Below the code I was trying to output the command variables!

Code: Select all


RunWait, K:\MacroCreator\DropBitch\DropBitch.exe

MsgBox, 0, , 
(LTrim
1: %1%
2: %2%

A_Args[1] %A_Args[1]%
A_Args[2] %A_Args[2]%

a_args[1] %a_args[1]%
a_args[2] %a_args[2]%

a_arg[1] %a_arg[1]%
a_arg[2] %a_arg[2]%

)
User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: MessageBox with Drag&Drop functionality

Post by Pulover » 29 Nov 2020, 05:17

The syntax is wrong. Read about expressions here. :arrow: https://www.macrocreator.com/docs/Variables.html
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
FilipeMeiraCastro
Posts: 28
Joined: 13 Jul 2014, 16:33

Re: MessageBox with Drag&Drop functionality

Post by FilipeMeiraCastro » 29 Nov 2020, 06:20

The following syntax for arrays is also not parsing as variable...

Code: Select all

A_Args[1]: % A_Args[1] 
a_args[1]: % a_args[1] 
a_arg[1]: % a_arg[1] 
User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: MessageBox with Drag&Drop functionality

Post by Pulover » 29 Nov 2020, 06:29

If you're putting that in a message box, it's still wrong...

Code: Select all

MsgBox,, % A_Args[1]
Also, it should be obvious, but you have to start it with arguments for it to have any content.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
FilipeMeiraCastro
Posts: 28
Joined: 13 Jul 2014, 16:33

Re: MessageBox with Drag&Drop functionality

Post by FilipeMeiraCastro » 29 Nov 2020, 06:43

Ok, It was not obvious that I need to start the MsgBox with the variable and not having anyother text!!

With the code below, now It is parsed as a variable, but it is the same variable as %1% which is the path for the PMC file and not the output of the previous command with RunWait!

Code: Select all

RunWait, K:\MacroCreator\DropBitch\DropBitch.exe
MsgBox, 0, , % A_Args[1]
User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: MessageBox with Drag&Drop functionality

Post by Pulover » 29 Nov 2020, 06:51

I guess I misunderstood what you meant. Maybe you are looking for the ErrorLevel variable, I don't know. You should read about the RunWait command in the AHK docs or ask at the help forum.
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
FilipeMeiraCastro
Posts: 28
Joined: 13 Jul 2014, 16:33

Re: MessageBox with Drag&Drop functionality

Post by FilipeMeiraCastro » 29 Nov 2020, 06:58

The errorlevel is only an integrer, I would need a string!
No bother, I'll do a workaround with a temporary text file!
Thank for your support :D
Post Reply

Return to “Pulovers Macro Creator”