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>
$paramPath:=“keyPath”
CLEAR LIST($P_List->;*)
$P_List->:=New list
DOCUMENT LIST($folderPath;$t_docPaths;Absolute path+Ignore invisible)
$N:=Size of Array($t_docPaths)
For($i;1;$N)
$docname:=dbz_textFunction(“Path_2DocName”;->$t_docPaths{$i})
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)
SHOW ON DISK($path)
</code 4D>

Ortwin:

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.

[]21915091;“Example”[/]

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

http://forums.4d.com/4DBB_Main/x_User/4018/files/21918076.zip

I will try to extract my actual code…

Hello,

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

Thank you in advance.

Axel

on macOS https://github.com/miyako/4d-plugin-workspace-services4d-plugin-workspace-services>

there is also a native command http://doc.4d.com/4Dv16/4D/16.3/GET-DOCUMENT-ICON.301-3652086.en.htmlGET DOCUMENT ICON>

Hello,

thank you all !

Solved!

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

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