AE ENHANCERS

Expressions/Scripts/Presets
It is currently Sun May 19, 2013 12:05 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: setProxy problem --- "Expected: )" ?
PostPosted: Mon May 28, 2007 7:41 am 
Offline

Joined: Fri May 25, 2007 8:38 am
Posts: 8
Location: Canada
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:
{ //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


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 28, 2007 11:58 am 
Offline

Joined: Thu Oct 21, 2004 12:36 am
Posts: 86
Location: Phoenix, AZ
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:
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().


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 1:31 pm 
Offline

Joined: Fri May 25, 2007 8:38 am
Posts: 8
Location: Canada
Aah, I see!

Thank you very much, vidpat!

_________________
My TMNT webcomic/manga online.
http://www.obscurezodiac.com


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 1 guest


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