BE_ListFilesInFolder - Add filters

Add the ability to do filtering by file type ( or perhaps name ).

Have more questions? Submit a request

6 Comments

  • 0
    Avatar
    Andrew Duncan

    One filter that would come in handy is the ability to filter out invisible files, e.g. the .DS_Store etc. I encountered this when using the plugin on the server and getting a list of files in the Data/Documents directory and it included the .DS_Store file which I don't recall it doing under FileMaker Pro.

  • 0
    Avatar
    Andrew Duncan

    Would also be great to have a parameter to not include the leading "/" on Mac OS X so that you just get the filenames instead of:

    /Contacts.fmp12
    /Import.log
    /Logfile.txt
    /settings.sav

    you get:

    Contacts.fmp12
    Import.log
    Logfile.txt
    settings.sav

  • 0
    Avatar
    Nicholas Orr

    I've added a grep function to the latest build to do general filtering, so this would be something you could use that for.

    If like to put together a bunch of examples of this, so if you do any, let me know.

  • 0
    Avatar
    Ian Renwick

    Like Andrew I thought an extra parameter to show invisible files with a True/False value would be helpful to avoid the “.DS_Store” files being listed which can happen when a file is moved from a folder and is no longer part of the folder contents (see value 3 below).

    BE_ListFilesInFolder also lists 'invisible' temporary files that show up as files replacing the original file name's first 2 letters with "~$" in the case of a MS Word file and just “~” for an Indesign file (see values 4 & 5 below). This occurs when the original files (see values 1 & 2 below) are open.

    1. Users/ian/Desktop/Matters/this is a quick test/My own title/2015 07 15 Conversation this is a quick test.docx
    2. Users/ian/Desktop/Matters/this is a quick test/My own title/Indesign test file.idd
    3. Users/ian/Desktop/Matters/this is a quick test/My own title/Solicitor/.DS_Store
    4. Users/ian/Desktop/Matters/this is a quick test/My own title/~$15 07 15 Conversation this is a quick test.docx
    5. Users/ian/Desktop/Matters/this is a quick test/My own title/~indesign test file~rkia(c.idlk

    I can rework my list using calculations (which creates other problems to solve) but thought an extra parameter to show invisible files with a True/False value would be simple for an end user.  Happy to test other applications with open files if you though this could become a future feature?

    You mentioned that you have added a grep function. I went looking and couldn’t find it or any other reference to it in relation to the Base Elements plugin. Could you give me a few more clues please as I am familiar with using grep functions with InDesign.

  • 0
    Avatar
    Nicholas Orr

    Ian,

    The show invisibles is a little tricky though, as the OS determines which files to show, based on it's own internal list of criteria.  So there is no "Invisible" checkbox we can go by...

    As for the grep, there's something coming soon.

    Cheers,

    Nick

  • 0
    Avatar
    Ian Renwick

    Nick, thanks for the response.

    I found a custom function that enabled me to filter a value based on a character/string. For others looking; www.fmfunctions.com/fid/86    

    Called: list.filter( listValues; test; dataType )

    If I substitute ".DS_Store" for "~" the function loops through the list and omits all files using the "~"  tilde character (which is not commonly used when naming files). I have it as an auto enter calculation of the field I'm dropping the result of the BE_ListFilesInFolder into. The Trim4 function was to get rid of a return that was a consequence of the list.filter function.

    Trim4 (

       List.Filter ( Substitute ( Self ; ".DS_Store" ; "~" ) ; 

                         "Filter ( value ; \"~\" )   ≠   \"~\" “  ;
                         "text" ) )
     
    I'm expecting the grep function will provide more options and look forward to seeing what it can do. 
Article is closed for comments.