pythontotal-commander

Run Python script with path as argument from total commander


I've got a script that accepts a path as an external argument and I would like to attach it to Total Commander.
So I need a script/plugin for TC that would pass a path of opened directory as an argument and run a Python script which is located for example at C:/Temp

How can I achieve this?

Best Regards, Marek


Solution

  • Ok, I managed to do it. You don't quite have to pass a path as an argument.
    You just need to add a quick button at the top of the TC.
    enter image description here

    As a Query just place python and location to Python script.
    You can either pass any argument if you want (but in this case you don't need this).
    As an initial path you set cm_AddPathToCmdline which returns a path to currently opened directory.
    And that's it. :)

    import os
    os.makedirs("TEST")
    

    enter image description here