Get the full path filename of a layer?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

Does anyone have any code that will fetch the full path filename of a layer?

I can't seem to find any way. I'm on CS3.
Last edited by Atomic on February 17th, 2009, 1:49 pm, edited 1 time in total.
"Up And Atom

No...No

Up And At Them!"
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

theLayer.source.name
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

on the subject.. anyone know how to get the full OS name of a sequence? ie if I import a sequence:

fileA_001.png
fileA_002.png
fileA_003.png

In AE I get:

fileA_[001-003].png

but sometimes if the file name is too long to fit i will get this:

fileA_[].png


Is there a way to get scripting to get me this:

fileA_001.png
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

theItem.file.name
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

Merci. :mrgreen:
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

Thats just the name of the layer, I need the fullpath file name to the footage of the layer.
"Up And Atom

No...No

Up And At Them!"
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

theLayer.source.file
theLayer.source.file.path
theLayer.source.file.absoluteURI

All the file related stuff is in the JavaScript Tools Guide
http://www.adobe.com/devnet/scripting/
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

Thanks Paul,

I could not find that info in the CS3 PDF Scripting Guide I was working from.
"Up And Atom

No...No

Up And At Them!"
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

Is there any way to repair the URI information returned to make a working path?

I get a value like this:
/e/My%20Documents/Maps/Animated/Cloud%20Tours/CF106.mov
This does not work on Windows. Is there a convert URI to working path function?

REVISION:
I did manage to get a working conversion from URI to Windows DOS path, but I doubt if this will work for OSX.
// Convert to Windows style file pathing.
G.LAYER_FILENAME = G.LAYER_FILENAME.replace(/%20/g," ");
G.LAYER_FILENAME = G.LAYER_FILENAME.replace(/\//,"");
G.LAYER_FILENAME = G.LAYER_FILENAME.replace(/\//,":\\");
G.LAYER_FILENAME = G.LAYER_FILENAME.replace(/\//g,"\\");
"Up And Atom

No...No

Up And At Them!"
Post Reply