Need help turning a command line to a button (combine PNG to Sprite sheet)

Hello, I need help putting together a button in Directory Opus that can be used to combine multiple PNG files into a single PNG sprite sheet. Currently I'm achieving this with a free program called ShoeBox (renderhjs.net/shoebox). This is the command line that the program provides to combine selected PNGs into a single sprite sheet (in this example, the files are called testfile_01.png to testfile_04.png)

CMD /C ""E:\Program Files (x86)\ShoeBox\ShoeBox.exe" "plugin=shoebox.plugin.spriteSheet::PluginCreateSpriteSheet" "files=E:\test\testfile_01.png,E:\test\testfile_02.png,E:\test\testfile_03.png,E:\test\testfile_04.png" "scale=1" "fileGenerate2xSize=false" "texPowerOfTwo=true" "texCropAlpha=true" "animationMaxFrames=100" "texMaxSize=4096" "useCssOverHack=false" "texExtrudeSize=1" "fileName=sprites.xml" "animationNameIds=@name_###.png" "renderDebugLayer=false" "fileFormatLoop=\t<SubTexture name=\"@id\" x=\"@x\" y=\"@y\" width=\"@w\" height=\"@h\"/>\n" "texSquare=false" "texPadding=2" "fileFormatOuter=<TextureAtlas imagePath=\"@TexName\">\n@loop</TextureAtlas>" "animationFrameIdStart=0""

Is it possible to turn this command into a Dopus button? I'm a complete newbie when it comes to Dopus scripting so I apologize in advance if this is a silly question.
Any help is greatly appreciated.

That will run as-is from an Opus button.

I presume you want to do more than just run it, e.g. pass the paths of selected files into it instead of the E:\test\testfile_xx.png paths.

What are all the changes you need to make to the command? How do you want it to work?

For example, do you want it to pass in all the selected files? Or to automatically generate the list of files somehow?

Does the "filename=sprites.xml" need to change with each command, or the sprites.xml file itself?

Any other changes needed?

Yes! I'd like the pass the paths of the selected files into it.
Basically what I'd like to do is selected a few PNGs, click this button and it'll automatically combine those PNGs into a single sprite sheet. Would this be possible?
The xml file is not important.

Just read through the documentation, putting {allfilepath} in place of the file paths didn't seem to work

The problem is that {allfilepath} will separate the filepaths with spaces, and it looks like you need them to be comma separated. At the moment there's no way to do that easily but we will add the ability in the next Opus 12 beta.

An alternative would be a script that built up the command line and then ran it.

Thanks Jon