Have a quick question that I can not find help with in the ESTB. I am trying to get the parent Folder name of a file without the full directory.
Folder - Need this Name
I have tried ($.SourceFile).parent; But it only returns "Desktop" not the Folder name.
in your scenario, all you have to do is get a reference to the File object then call it's parent property.
same question here: what is $.SourceFile ?
var file = File('~/Testfolder_1/Testfolder_2/check.jpg'); // replace with the path to your own file alert(file.parent.name); // get: Testfolder_2 alert(file.parent.parent.name); // get: Testfolder_1
Got this to work. What I am trying to do is prompt for a file to open, then open the same file in a different directory. This came up with the correct response. Thanks for your help guys.
var OpenDir = Folder ("/Users/ME/Desktop/Proof/")
var SourceFile = OpenDir.openDlg("Select Your Proof File",);
var SourceDir = Folder (SourceFile.parent.name);
alert("/Users/ME/Desktop/Layout" + SourceDir);