Problems with multi-column output from system.callSystem() in After Effects 7?

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.

2 Comments

  1. Christopher Prosser said

    A hang? That just plain sucks. Internally we’re using NSProcess to sublaunch and redirect io, but I can’t think of any reason why it would hang with columnar output.

    In the future, drop an email to aebugs@adobe.com and we’ll look at it.

    –chris
    ae engineering

  2. Dale said

    Hi chris,

    Thanks for the comment.

    Actually, I just checked this again and I think it is machine specific. On one machine I can get multi-column output, but running the same script on my dev box still hangs AE. Is there a debug flag to send the NSProcess output to the console?

    Also, thanks for the bugs email address I’ll send potential bugs there from now on.

    Thanks again,

    Dale

RSS feed for comments on this post

Comments are closed.