Author Topic: Execute items programmatically  (Read 19200 times)

em

  • Newbie
  • *
  • Posts: 9
    • View Profile
Execute items programmatically
« 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

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4490
    • View Profile
    • Multi Commander
Re: Execute items programmatically
« Reply #1 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. )


em

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Execute items programmatically
« Reply #2 on: May 02, 2013, 10:40:16 »
Very nice. Thank you.

Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 555
  • Old Skull
    • View Profile
Re: Execute items programmatically
« Reply #3 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

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4490
    • View Profile
    • Multi Commander
Re: Execute items programmatically
« Reply #4 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