How to get app.project.item(1)'s path?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
peteoconnell
Posts: 19
Joined: November 14th, 2004, 2:10 pm

Hi, I can't seem to find anything in the documentation about getting a certain item's path. I am making a script that batches some sequences into mov proxies and what I can't seem to do is access each sequence's folder's path to tell the mov file to write itself to that location.
Help
Pete
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

peteoconnell wrote:Hi, I can't seem to find anything in the documentation about getting a certain item's path.
hi pete,

you can get the path for the first item by using:
app.project.item(1).file.path

the file attribute for the FootageItem points to a File object. the path attribute for a File object is a string of the path part of the file name.

hope this helps.

:jeff
peteoconnell
Posts: 19
Joined: November 14th, 2004, 2:10 pm

Hi Jeff thanks for your answer. I pretty sure "Path" isn't mentioned as far as I can tell under "FootageItem object" and if you happen to look under "Item Object" rather than "FootageItem object" File isn't listed as a possible property. I sort of understand why, but it is kind of terse for non-coders like myself. Any news about when the CS4 guide is coming out?
Pete
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

hi pete,

footage in the Project panel is a FootageItem object (which inherits all attributes and methods of the base Item object); an item in the Project panel can be a comp (CompItem), folder (FolderItem), or footage (FootageItem).

In the FootageItem object description, there is a file attribute. This attribute points to a File object. A File object is a general ExtendScript object (i.e., it's common to other Adobe apps that support ExtendScript scripting), so it's documented in the JavaScript Tools Guide, which you can access from the ExtendScript Toolkit's Help menu or Help > SDK submenu. In this separate document, the File object has a path attribute that is the path part of the file name. hope that's clearer. :-)

the Scripting Guide is currently being updated for CS4, and the author of this version is trying to get as many improvements into it as possible. however, i don't have an ETA for you right now. i'll try to check on that. when ready, it will be posted online at: http://www.adobe.com/devnet/aftereffects/

:jeff
peteoconnell
Posts: 19
Joined: November 14th, 2004, 2:10 pm

Hi Jeff thanks for you explanation. I sent an email to Todd Kopriva asking about maybe getting some kind of comprehensive inheritance tree for the next scripting guide.
Pete
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

hi pete,

current estimate is around the end of January for the updated document.

:jeff
Post Reply