Using a script from command line

Hi there, is it possible to run a script from the command line? I currently export all my assets with the command line. What I would like to do is to change colors on some layers when exporting while leaving the .ase file intact. My goal is to cut all rgb values in half except for a specific layer.

/Thanks

Hi @Filip! :wave: You can use scripts from the command line using the -script option (and -script-param in case that you need to pass parameters to the script). E.g.

aseprite -b -script-param filename=player.ase \
            -script-param output=player-output.ase \
            -script cutrgbvalues.lua

And then in cutrgbvalues.lua:

local spr = app.open(app.params["filename"])
-- ...
spr:saveCopyAs(app.params["output"])
2 Likes

Cool, thank you!

2 Likes