Multi Commander Support Forum

Multi Commander => Support and Feedback => Topic started by: em on May 02, 2013, 04:12:40

Title: Execute items programmatically
Post by: em on May 02, 2013, 04:12:40
Is there any way to execute an item programmatically in MultiScript, that takes into account the "File Type Setup"?

Something like MC.View or MC.Edit but for Launcher (Run/Open).

Regards,
Em
Title: Re: Execute items programmatically
Post by: Mathias (Author) on May 02, 2013, 10:25:47
You can use

"MC.CmdLineRun CMD=<command to run>"

It will run command like if they was run from the command line field. And it will use the FileTypeSetup for Run/Open.

But I think I will add a MC.Open (or something) that gives a bit more control (with working folders and parameters. )

Title: Re: Execute items programmatically
Post by: em on May 02, 2013, 10:40:16
Very nice. Thank you.
Title: Re: Execute items programmatically
Post by: Jungle on May 02, 2013, 10:47:57
I've set up *.txt and *.ini to edit/execute via akelpad. It works ok from the file panel. But:

1. If i launch command e.g. myfile.ini from command line, default program (notepad) is launched.
2. I've created user command MC.CmdLineRun CMD=${focusfilepath} and assigned it to a button. But when i click this button file is not launched, it is just focused instead as if i typed "myfile.ini" (with quotes) in the command line
Title: Re: Execute items programmatically
Post by: Mathias (Author) on May 02, 2013, 11:04:58
2. I've created user command MC.CmdLineRun CMD=${focusfilepath} and assigned it to a button. But when i click this button file is not launched, it is just focused instead as if i typed "myfile.ini" (with quotes) in the command line
That is since a full path entered into the commandline field will make it go to that path.. But if you enter a ! before the path it will force to run it.. so
MC.CmdLineRun CMD=!${focusfilepath}

But using CmdLineRun for it is like a workaround, adding new custom command will make it work better and be able to control it better with STARTIN path and more.
hmm when thinking about it a new command might be unless. Better to add an option to MC.Run so it should just the FileTypeSetup