Author Topic: Current Folder Column  (Read 5762 times)

0 Members and 1 Guest are viewing this topic.

RW

  • Newbie
  • *
  • Posts: 4
Current Folder Column
« on: July 21, 2015, 06:32:24 PM »
Could a column be created that just shows the "current folder" name of the current file, not all the other folders that this current folder is nested under. 
And this column would need to be exportable to a csv file also.

I don’t want the column that has all this      c:\pictures\2015\summer\
I just want the column to show only the last folder called       summer\    or    summer

RTT

  • Administrator
  • *****
  • Posts: 907
Re: Current Folder Column
« Reply #1 on: July 22, 2015, 12:57:30 AM »
As with the column part of this example, set a custom field, with a custom grid layout to show it, and use the Edit Info Fields batch tool with this GetParentFolderName named script.
Code: [Select]
function GetParentFolderName() {
    var path = BatchFile.Filename.substring(0,BatchFile.Filename.lastIndexOf('\\'));   
    //remove parent folders
    path = path.substring(path.lastIndexOf('\\')+1);
    return path;
}

RTT

  • Administrator
  • *****
  • Posts: 907
Re: Current Folder Column
« Reply #2 on: July 22, 2015, 01:21:47 AM »
Or just use a custom grid layout dynamically calculated column, with this code as the eval expression:
Code: [Select]
begin
var 'i','path' end;
$path:=leftstr(FP,length(FP)-1);
$i:=pos('\',reversestr($path));
return(rightstr($path,$i-1));
end