Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Troi File -- list of multiple levels of folders, files

Featured Replies

Hey folks,

A bit about me:

I used to be way into FileMaker and got into some fairly complex scripting and relational design, but I have not had too much time for FMP the last couple of years. I have had some basic experience with a couple of plug-ins.

In any case, I would like to print a hierarchical list of folders and files in a given folder, i.e.}:(

Master Folder

---Subfolder I

------File A

------File B

---Subfolder II

------File A

------File B

------Subfolder A

---------File 1

---------File 2

Based on a perusal of the Troi File plug-in, it does not appear to have a function to do this all at once. (Please correct me if I am mistaken, and I will happily make use of it!)

Other than that, I realize I could I could write a script to tell Troi to grab the top level of file and folder names (in the above example Subfolders I and II.)

Then, I could have it loop through and pass those top level folder names through as a variable to grab the folders and files in each of those subfolders, and so on and so forth.

I would actually like to take this on just in terms of the challenge. However, I know there would be quite a few hurdles to overcome and that it would take quite a while.

Given my limited time right now, if anyone has such a script available and would be willing to share it, I would be most grateful.

Thanks,

Kevin

Getting the contetns of everything is easy, its sorting it that can be a pain.

I actaully have built a program called Super Scan that litteraly does what you just said, it loops through folders, finds everything, and prints out a report giving create/mod date, file size, all that fun stuff, then it copies files down to a local hard drive, keeping the folder structure it has on the disk. It was a lot of fun to build.

  • Author

Is Super Scan commercially available? If not, is that something you are willing to share?

Thanks,

Kevin

Getting the contetns of everything is easy, its sorting it that can be a pain.

I actaully have built a program called Super Scan that litteraly does what you just said, it loops through folders, finds everything, and prints out a report giving create/mod date, file size, all that fun stuff, then it copies files down to a local hard drive, keeping the folder structure it has on the disk. It was a lot of fun to build.

How about using the command line "dir /S" to produce the report to a text file and importing that text file? Would need some post-processing probably but it'd be fast and cheap.

  • Author

Wim,

Thanks for the suggestion. Could you (or anyone else who would like to chime in) possibly tell me the syntax to use on the command line, assuming these files are on a Linux server, such that the file path in Windows is:

serverfoldersubfolder

I'm really not that much of an all-around IT person, more of a liberal arts major who happened to get into FileMaker. :grad:

Thanks again,

Kevin

How about using the command line "dir /S" to produce the report to a text file and importing that text file? Would need some post-processing probably but it'd be fast and cheap.

this command line will give you all files in that folder and all of its subfolders:

dir /S serverfoldersubfolder*.*

to output that to a text file add this:

> c:myDirList.txt

So from inside FM you would use a Send Event script step that would (hardcoded or calculated) result in this string:

cmd /c dir /S serverfoldersubfolder*.* > c:myDirList.txt

(make sure to use quotes around paths that have space in them)

In your script give Windows enough time to compile that list (depends on how big it is, a couple of seconds pause), then import "c:myDirList.txt".

If you're not using FM8 then you'll need to hard code the location of that file in your script.

To clean up, fire another Send Event after the import to delete that text file:

cmd /c del c:myDirList.txt

  • Author

Wim,

Thanks for all the help -- I got the file/folder list dumped into a text file.

Now I'll see if I can use FMP to wrestle the data into a nicer format.

Regards,

Kevin

Edited by Guest

  • Author

Thanks again Wim,

After a few hours, a couple scripts, and some sloppy text calculations, I've got everything I need -- the good thing is I now have the structure to create these types of reports quickly in the future.

I even used a container calc which would display a folder icon to help visually differentiate files from folders.

DD

Edited by Guest
can't type right

Glad it helped.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.