Author Topic: Can MC.RunUserCmd also run Multi Scripts (or only Custom commands)?  (Read 16526 times)

AlanJB

  • VIP Member
  • *****
  • Posts: 433
  • VERY old Programmer
    • View Profile
Prompted by my question in http://forum.multicommander.com/forum/index.php/topic,1726.0.html

Can MC.RunUserCmd also run Multi-Scripts (or only Custom commands)?

I have a working Multi-Script bound to Ctrl+Backspace as follows:

Code: [Select]
# Go to Drive Root
MC.RunCmd ID=ExplorerPanel.41053;
# Go to top
MC.RunCmd ID=ExplorerPanel.41075

(Some of my tabs are locked below the physical drive root, so "Drive Root" is actually "Tab Root").

However, when I attempt to include this at the end of a new Multi-Script with
Code: [Select]
...
...
MC.RunUserCmd ID=41137de592511df9a3a39b11165bcf44

only the "# Go to Drive Root" is run.  The "# Go to top" never executes.

Any ideas?


Alan



Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4409
    • View Profile
    • Multi Commander
Running a command that run a command.
It is possible that it get some weird deadlook. It is nothing that is officially supported. if it works it works.. I think it depends on the commands that are called

RunCmd are normally not async, But depending on command the underlaying command can move on to a background thread and the command can return before it is complete.
but RunCmd has the "ASYNC" option.. With this it will just fire the command and move on.
But if you have multi commands like that in a MultiScript, it can have a strange affect. They might kind of collide if they are doing work in the same area

It running the MultiScript in the background it might be possible to call RunCmd with ASYNC and then do a Sleep( <time in ms> ) call before sending the other command.
« Last Edit: May 04, 2016, 19:34:33 by Mathias (Author) »