Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Recoginize file type with expressions?

Cow Forums : Adobe After Effects Expressions

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Recoginize file type with expressions?
by Mats Jacobsson on Jun 29, 2009 at 2:46:01 pm

Hi!

Is there an expression to recognize if the source file to a layer is vectorized or pixelated? It would also work if the expression just could detect the filetype of the layer.

Thanks in advance!



Respond to this post   •   Return to posts index

Re: Recoginize file type with expressions?
by Dan Ebberts on Jun 29, 2009 at 2:57:28 pm

Only if you can deduce it from the name of the source file (probably by looking at the file extension). Here's an example that should detect PSD files (not tested, so watch out for typos):


mySplit = thisLayer.source.name.split["."]; // split source name at "." characters
myExtension = mySplit[mySplit.length - 1]; // get everything to the right of the last "."
if (myExtension.toLowerCase() == "psd"){
// it's a psd file
}else{
// it's not a psd file
}


Dan




Respond to this post   •   Return to posts index

Re: Recoginize file type expressions?
by Jean Pierre Biasiolo Mérchan on Jun 29, 2009 at 6:17:11 pm

Dan you're the best because even though the topic was not for me has served me very
Un saludo

Thanks you're the best, but it was not the issue for me has a lot of greetings

Respond to this post   •   Return to posts index


Re: Recoginize file type with expressions?
by Mats Jacobsson on Jun 30, 2009 at 7:02:14 am

Wow, thanks a lot! Just what I needed.

There was one small typo however, it should be (".") instead of ["."] to work:

mySplit = thisLayer.source.name.split("."); // split source name at "." characters
myExtension = mySplit[mySplit.length - 1]; // get everything to the right of the last "."
if (myExtension.toLowerCase() == "psd"){
// it's a psd file
}else{
// it's not a psd file
}



Respond to this post   •   Return to posts index

Re: Recoginize file type with expressions?
by Dan Ebberts on Jun 30, 2009 at 1:31:25 pm

Good catch. I'm glad you figured it out and that it works for you.

Dan



Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]