Reply To: Run macro upon startup

Product Compare Forums Multi-Edit Support Run macro upon startup Reply To: Run macro upon startup

#6798
deleyd
Participant

Use Param_Str to get command line parameters. Command line parameters are separated by a space. You can enclose a parameter in double quotation marks " to make it one parameter if there’s a space in it.

Example 1:
If the command line is:

"C:\Program Files\Multi-Edit 2006\Mew32.exe" /NS /Rtest^test "/P=12345678912345678921234567893This is a very long line"

then
Param_Str(0) = "C:\Program Files\Multi-Edit 2006\Mew32.exe"
Param_Str(1) = "/NS"
Param_Str(2) = "/Rtest^test"
Param_Str(3) = "/P=12345678912345678921234567893This is a very long line"

Example 2:
If we didn’t have the double quotes around the last parameter:

"C:\Program Files\Multi-Edit 2006\Mew32.exe" /NS /Rtest^test /P=12345678912345678921234567893This is a very long line

then
Param_Str(0) = "C:\Program Files\Multi-Edit 2006\Mew32.exe"
Param_Str(1) = "/NS"
Param_Str(2) = "/Rtest^test"
Param_Str(3) = "/P=12345678912345678921234567893This"
and Multi-Edit tries to open five files named:
is
a
very
long
line

There’s not a lot you can do in a /R<macro_name> macro because it’s run so early in the startup that Multi-Edit isn’t yet ready to do routine things.

you should take into consideration that not everything in Multi-Edit has been initialized when the macro executes.[/quote:3gwdywgh]

You can try creating a macro named STARTUP.S . Attached is a sample. Compile it so it creates a file STARTUP.MAC in the Multi-Edit\mac folder. This was the old way.

The new way is to modify the files startup.cfg and/or startup2.cfg in the Multi-Edit\Config folder. See Multi-Edit v9.10 Manual pg 186 Startup.cfg and Startup2.cfg Files, and see Update Script Reference starting on pg 188.
STARTUP.S