March 3, 200619 yr 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
March 3, 200619 yr 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.
March 3, 200619 yr 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.
March 4, 200619 yr 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.
March 6, 200619 yr 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. 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.
March 6, 200619 yr 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
March 6, 200619 yr 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 March 6, 200619 yr by Guest
March 7, 200619 yr 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 March 7, 200619 yr by Guest can't type right
Create an account or sign in to comment