I’ve been experimenting with system.callSystem() in After Effects 7. It’s a way to call commands and applications like you would from the command line but from within the After Effects scripting environment and get the output returned to the javascript variable. Works pretty great, but I’ve run into what seems like a bug and offer a small work around
If I call
var systemCall = system.callSystem('ls');
alert(systemCall);
I get a nice alert box with my local directory. If I call
var systemCall = system.callSystem('ls -a');
alert(systemCall);
I get a nice alert box including . entries (which is really just to test using the -a command switch to make sure I can send parameters through system.callSystem()). If i call
var systemCall = system.callSystem('ls -la');
alert(systemCall);
I lock up AE7. I’m guessing it doesn’t like the multi-column output? Because if I pipe the ls -la to awk like so
var systemCall = system.callSystem('ls -la | awk '{print $1}');
alert(systemCall);
I get a nice listing of my directory permissions which is the first column of the ls -la standard output.
So, it looks like the workaround if you freeze After Effects 7 with a system.callSystem() command that ouputs multi column output is to grab each column of interest with something like awk’{print $1}’ where $1 etc. is the column to grab. Not sure if this is a bug or a limitation of the standard output to After Effects. Would love some feedback from anybody that knows for sure.