Target current or last active Aseprite process with cli command

I’m working on a little batch script that takes an ase file, upscales it, runs a python script on it to do some ai stuff, then copies the modified sprite onto a new layer in the original sprite.

I’d like to be able to run this batch file anywhere (or trigger it from an Aseprite extension, though I’d imagine lua is sandboxed such that you couldn’t…?) and have it run the generation on the last active instance of aseprite / last active sprite. It’s currently working, but the .bat file needs to be given the name of the target .ase file, and then you need to close and reload the sprite to see the new layer appear.


Hi @Ben_Peterson, you can use os.execute() to run an external command (you will be asked to give permission to do so if the UI is available):


In case you need to pass some argument to the script via CLI, you can use -script and -script-param ( Aseprite - Docs - Cli ), probably you can use a .lua script directly instead of a .bat.


Thanks for the swift response! Not sure how I missed the notification email. This should allow me to rework so I can map the operation to a nice hotkey rather than my current janky external CLI workflow as wel

1 Like