Returning a value from a wildcard

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
adamghering
Posts: 22
Joined: April 2nd, 2010, 1:14 am

I would like to look inside a directory and return the value of that directory using a wild card

I.E.

Myfile = new File("c:\\User\\*.jsx");

Is there any way to get something similar to this to return the actual name of whatever file is in the folder specified?
Adam Ghering
Compositing Supervisor
Legend Films inc.
2D/3D Stereo Conversion
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I've not tried it myself, but this is from the Javascript Tools Guide:
http://www.adobe.com/devnet/scripting/

folderObj.getFiles ([mask])
mask Optional. A search mask for file names. A string that can contain question mark (?) and asterisk (*) wild cards. Default is "*", which matches all file names.
adamghering
Posts: 22
Joined: April 2nd, 2010, 1:14 am

Thank you so much and for your other replies ...worked great
Adam Ghering
Compositing Supervisor
Legend Films inc.
2D/3D Stereo Conversion
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Did you get the wildcard working? It would be good if you could post an example for reference.
adamghering
Posts: 22
Joined: April 2nd, 2010, 1:14 am

Yeah that fixed two things for me ...the wildcard and the returning an array of files inside a folder....I just parsed out the one I wanted.

This is a deployment script that will copy a preferences script from the server to the artists local machine so all AE artists upon opening the program will have all the same project and preference settings.


MyFolder= new Folder("//isilon/data/departments/comp/AE_Scripts/Startup/Prefs/");
MyFile = MyFolder.getFiles("*.jsx");
MyScript = MyFile[0];
MyScript.copy("C:\\Program Files (x86)\\Adobe\\Adobe After Effects CS4\\Support Files\\Scripts\\Startup\\"+ MyScript.displayName);

thanks
Adam Ghering
Compositing Supervisor
Legend Films inc.
2D/3D Stereo Conversion
Post Reply