Sublime Forum

How to: run multiple commands from command line?

#1

Hi, I want to do something like this subl ./testfile.csv --command replace_smart_characters --command save --command close, but no matter what variations I try, I’m falling short. Alternatively something like this sub ./testfile.csv --command replace_smart_charcters > outfile.csv, anything to help automate this would be great.

Thanks in advance for any advice.

0 Likes

#2

Typically I imagine the best way to do it would be to have a command or macro to execute the other commands, and invoke that from the CLI. And/or make two separate invocations to ensure the file has finished loading before it tries to execute the commands. Maybe something like

subl ./testfile.csv
subl --command 'chain { "commands": [ {"command": "replace_smart_characters"}, {"command": "save"},  {"command": "close"} ] }'
1 Like