Code to Display Array of Filepaths in an hList

I want to display the content of the array populated by Document list in a hierarchical list. The client is an historically Mac company that is moving files to a Windows server. They have years of files with file names that contain characters that are invalid on Windows so they need to find the files that have invalid characters and update the file names.

A mass file name update is not acceptable and they don’t have the skills or patience to find and change the file names by hand. My thinking is to load the file list using Document list and to display the files that have invalid characters in a Finder-like interface based on a hierarchical list.

Does anyone have code to convert an array of fielpaths to an hList or, perhaps, can point to a source for that code?

Thanks in advance.

I don’t do this in hierarchical lists, but hierarchical listboxes.

<code 4D>
CLEAR LIST($P_List->;*)
$P_List->:=New list
DOCUMENT LIST($folderPath;$t_docPaths;Absolute path+Ignore invisible)
$N:=Size of Array($t_docPaths)
APPEND TO LIST($P_List->;$docname;$i)
SET LIST ITEM PARAMETER($P_List->;$i;$paramPath;$t_docPaths{$i})
end for
SORT LIST ( P_List->;>)
</code 4D>

and when a row is doubleclicked, I’d
<code 4D>
GET LIST ITEM PARAMETER($P_List->;$itemRef_L;$paramPath;$path)
</code 4D>


I was planning on creating a Finder-like UI to present the file names to the user and then update the file using Miyako’s “Renamer” plug in. That’s nice UI but it would be a fair amount of work.

After working with the code you’ve posted, your approach is much easier to code and is very intuitive for the end user.

Thank you!

What you are looking for has been published in french magazine Planete 4D, years ago.

I use it in my database and have improved it.
But it is rather difficult to extract the code that is disseminated and my right arm is out of service for at least one month.

Give me your email and I will try to send you something.


I have found the original database in my archives but you will need a 4D version 6.5 or 2004 to convert it !

I will try to extract my actual code…


but how to get the pict´s (from harddisk or files)?

Thank you in advance.


on macOS>

there is also a native command DOCUMENT ICON>


thank you all !


[]21940491;“Your comment here…”[/]

[]21940494;“Your comment here…”[/]