setProxy problem --- "Expected: )" ?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
Tigerfog
Posts: 8
Joined: May 25th, 2007, 8:38 am
Location: Canada
Contact:

Hi everyone.
I have a problem with my script.
I am merely trying to set a proxy using only ae scripting.
However, everytime I run the script, I have an error.

Here is my script:

Code: Select all

{ //start main function

app.beginUndoGroup("mainprog");

var myCompItem = app.project.item(2);		//a var for the composition

var selItems = app.project.selection;		//a var for the selection
myCompItem.layers.add(selItems[0]);		//the file is brought in the composition, centered
var firstLayer = myCompItem.layer(1);		//a var for the first layer
firstLayer.scale.setValue([200,200,100]);	//scaling the first layer to fit

selItems[0].setProxy(file "/system/Users/hpham/Desktop/proxytest1.psd");

}
The error I get is "Expected: )" on the line with setProxy.
Can anyone explain to me what I did wrong?
My TMNT webcomic/manga online.
http://www.obscurezodiac.com
vidpat
Posts: 86
Joined: October 21st, 2004, 12:36 am
Location: Phoenix, AZ
Contact:

setProxy() expects a single argument of type File. As written, there are two tokens in the parameter list (a bare word and a string literal). The parser is expecting the list to end with a ')' after the token 'file', which itself doesn't mean anything.

I believe you are looking for this, instead:

Code: Select all

selItems[0].setProxy(new File("/system/Users/hpham/Desktop/proxytest1.psd"));
This creates a new File object to the path that is then passed to setProxy().
Tigerfog
Posts: 8
Joined: May 25th, 2007, 8:38 am
Location: Canada
Contact:

Aah, I see!

Thank you very much, vidpat!
My TMNT webcomic/manga online.
http://www.obscurezodiac.com
Post Reply