Launch an external Lua process?

How feasible is it for the Renoise scripting API to launch an external Lua process?

Basically:

$ lua xrns_merge.lua /path/to/file1.xrns /path/to/file2.xrns /path/to/output.xrns  

This way I could rewrite my merge script knowing that Lua is available on the user’s platform, because they run Renoise.

Thanks.

os.execute?

The problem is that os.execute() wants /path/to/lua the same as I would have to deal with /path/to/php

A typical user probably doesn’t have Lua (or PHP) anywhere.

I’m looking for a guaranteed-to-be-there solution.

The question for me would be, why you’d still want to rely on the commandline when a Renoise tool could offer you either an own GUI for file selection, similar to what the Windows frontend did, or simply file handling dialogs to populate your variables. You can supply also third party binaries you can use with your tool and call those from the commandline then. A call to “os.currentdir()” will give you the path to your tools folder which you can further work with. A tool could also offer loading the merged song after the process finished.

Small example here how i used zip/unzip binaries and did some stuff to the XML. In my case windows only, but it would be possible to supply those for all platforms or simply rely on the user to have them in a search path.