Skip to main content
Participant
November 17, 2013
Answered

Folder.name returning 'Folder' and not original folder name

  • November 17, 2013
  • 1 reply
  • 874 views

Hi, thanks for viewing

I was in the process of writing a script which adds folder bins to your project and names them according to the folder names from the source.

I'm using the script below to figure out what's going on. I thought this would return my original folder name but instead it comes back with 'Folder'. Does anyone know what I'm doing wrong?

Folder.selectDialog("Select folder...");

alert(Folder.name);

Cheers

This topic has been closed for replies.
Correct answer Paul Tuersley

You're problem was that "Folder" isn't a variable, it's the function that creates the folder object. You need to assign the folder object to its own variable in order to access it:

var theFolder = Folder.selectDialog("Select folder...");

alert(theFolder.name);

1 reply

Dan Ebberts
Community Expert
Community Expert
November 17, 2013

This should work:

var myFolder = app.project.selection[0];

alert(myFolder.name);

Dan

Participant
November 17, 2013

Thanks Dan, but this is not quite what I was looking for.
I'm trying to use the name of the folder from a location on my hard drive (e.g ..User\Documents\Videos\My_Folder) - not from a folder in AE.

I want to be able to select 'My_Folder' using a selectDialog(), and have the script import all the footage into a folder bin in AE named My_Folder. The only problem I'm having is not being able to retrieve the original 'My_Folder'

Paul TuersleyCorrect answer
Inspiring
November 17, 2013

You're problem was that "Folder" isn't a variable, it's the function that creates the folder object. You need to assign the folder object to its own variable in order to access it:

var theFolder = Folder.selectDialog("Select folder...");

alert(theFolder.name);