How to pass command-line arguments to PMC script?

Advanced Macro Recorder/Editor.

Moderator: Pulover

alanchung
Posts: 3
Joined: 13 Apr 2021, 14:46

How to pass command-line arguments to PMC script?

Post by alanchung » 13 Apr 2021, 15:02

I run my Macro Creator PMC scripts from Windows Scheduler or command prompt like below:
"C:\Program Files\MacroCreator\MacroCreator.exe" "my.pmc" -s1

I like to pass some arguments like
"C:\Program Files\MacroCreator\MacroCreator.exe" "my.pmc" -s1 arg1 arg2

and then access the arguments in the script. I know it is possible to do so from AHK script (see https://superuser.com/questions/1401680/how-to-pass-command-line-arguments-to-ahk-script). I would like to know how to do the same from a PMC script.
User avatar
Pulover
Posts: 612
Joined: 29 Sep 2013, 19:51
Location: Brazil
Contact:

Re: How to pass command-line arguments to PMC script?

Post by Pulover » 14 Apr 2021, 05:36

You can find all arguments on the A_Args array :arrow: https://www.autohotkey.com/docs/Variables.htm#Args

Code: Select all

[PMC Globals]|None||
[PMC Code v5.4.1]|F12||1|Window,RegEx,Fast,1,1,Input,-1,-1,1|1|Macro1
Context=None|
Groups=Start:1
1|[MsgBox]|% A_Args[1] "`n" A_Args[2] "`n" A_Args[3]|1|0|MsgBox|0||||1|

c:\Program Files\MacroCreator\MacroCreator.exe "file.pmc" -a customArgument
Rodolfo U. Batista
Pulover's Macro Creator - Automation Tool (Recorder & Script Writer)
Post Reply

Return to “Pulovers Macro Creator”