Moderator: Paul Tuersley

Topic Author
Posts: 114
Joined: Thu Mar 10, 2005 5:50 am
Location: London, UK

Running scripts from the command line: Scripting Guide ERROR

Sat Mar 04, 2006 2:35 am

The example code in the Scripting Guide to launch scripts from the command line contains a grammatical error, that will cause your scripts NOT to run.

Basically, the code therin is formatted using an em-dash – rather than a hyphen - (as Windows expects). If you were to copy and paste the code to a fixed-width code editor, both the characters above would display identically:

 - (hyphen)
 â€“ (dash)

When in actual fact they are completely different:

- (hyphen)
– (dash)

Therefore running the code, even for testing purposes, will launch After Effects, but throw the error: "After Effects error: invalid file location specification (must include name)."

This may lead you to the conclusion that:

a) your script path is wrong
b) you've badly formatted the quotes
c) you're insane

The real answer is "none of the above". Once After Effects reaches the em-dash, it will just presume that you neglected to enter a path.

End result - TYPE the code yourself and save the headaches, or copy and paste the following code:

afterfx.exe -s "alert ('You just sent an alert to After Effects')"
afterfx.exe -r c:\temp\yourAEScriptHere.jsx

Happy programming :)
Posts: 13
Joined: Tue Apr 28, 2009 8:11 am

Re: Running scripts from the command line: Scripting Guide ERROR

Thu Jun 04, 2009 3:44 am

Hi all,
I want to point something out which gave me quite a headake and maybe I can prevent others from having the same.

The line dave pointed out works well:
afterfx.exe -r c:\temp\yourAEScriptHere.jsx

This line does also work as expected:
afterfx -r "c:\temp\yourAEScriptHere.jsx"

But this line throws an error ("no read access to file"):
afterfx.exe -r "c:\temp\yourAEScriptHere.jsx"

I'm sure there is a proper explanation for this, but it's not very straight forward: Why is the interpretation of quotes handled differently depending on writing ".exe" after the application name?
Anyway - keep it in mind:
If you use quotes, don't write ".exe" after "afterfx"!
(btw: WinXP Pro 64-bit SP2, After Effects running in 32-bit)

Happy programming :)
Posts: 108
Joined: Wed Jun 25, 2008 4:55 pm

Re: Running scripts from the command line: Scripting Guide ERROR

Thu Sep 10, 2009 8:30 am

Exactly! I never understood it had to do with writing .exe or not!

Without .exe it works fine, but with .exe and quotes my After Effects sais "You don't have permission to read this file."

I always thought it depended on whether or not After Effects was having one of those days. But apparently sometimes I type .exe and sometimes I don't.

Thanks for mentioning it.
avi + m2t -> Vdub + DGIndex -> AE CS3 -> x264 -> Hell On Earth :mrgreen:

Who is online

Users browsing this forum: No registered users and 3 guests