AE ENHANCERS

Expressions/Scripts/Presets
It is currently Wed Apr 23, 2014 9:11 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Running scripts from the command line: Scripting Guide ERROR
PostPosted: Sat Mar 04, 2006 2:35 am 
Offline

Joined: Thu Mar 10, 2005 5:50 am
Posts: 114
Location: London, UK
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:

Code:
- (hyphen)
– (dash)


When in actual fact they are completely different:

Quote:
- (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:

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



Happy programming :)


Top
 Profile  
 
 Post subject: Re: Running scripts from the command line: Scripting Guide ERROR
PostPosted: Thu Jun 04, 2009 3:44 am 
Offline

Joined: Tue Apr 28, 2009 8:11 am
Posts: 13
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:
Code:
afterfx.exe -r c:\temp\yourAEScriptHere.jsx

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

But this line throws an error ("no read access to file"):
Code:
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 :)


Top
 Profile  
 
 Post subject: Re: Running scripts from the command line: Scripting Guide ERROR
PostPosted: Thu Sep 10, 2009 8:30 am 
Offline

Joined: Wed Jun 25, 2008 4:55 pm
Posts: 108
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:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group