14 Replies Latest reply on Aug 15, 2017 1:28 PM by wfgclapp

    Hide a local file from user in FmGo?

    wfgclapp

      I have a local file solution deployed via FmGo that consists of a UI file and a Data file.

       

      I don't need the users opening the Data file directly, so I would like to hide it in the Launch Center. Does anyone know of a way to do this? Or simply ideas for handling this kind of situation where you want the users opening the UI file only? Here's only thing I could think of...

       

      1. Contain the data file in a container within the UI file and export it for use when the UI file opens. Then insert back into the container and delete file upon exit. Of course, if user doesn't exit in a way that uses your cleanup script, then the file would remain on the device.

      2. Could perform some kind of check on startup of the data file that would not allow access if the UI file was not open?

       

      This isn't the end of the world but I would like things to look clean for the users and not have to continually answer the question of, "Hey, what's this other file for?"

        • 1. Re: Hide a local file from user in FmGo?
          rgordon

          A file name that begins with a dot will be hidden in the list of files.  Another option is to have the file open to a layout with a large button that closes the files and opens the appropriate file.

          1 of 1 people found this helpful
          • 2. Re: Hide a local file from user in FmGo?
            wfgclapp

            rgordon wrote:

             

            A file name that begins with a dot will be hidden in the list of files.

            Yep, that did the trick! This is great, I didn't expect it to be this easy.

             

            Thank you rgordon!

            • 3. Re: Hide a local file from user in FmGo?
              beverly

              Glad it worked for Martin! Is there any potential "down-side" for starting the file name with "."? Not just IN FMGo but elsewhere?

              Beverly

              • 4. Re: Hide a local file from user in FmGo?
                wfgclapp

                beverly wrote:

                 

                Glad it worked for Martin! Is there any potential "down-side" for starting the file name with "."? Not just IN FMGo but elsewhere?

                Beverly

                Well...that's what I'm looking for now. I'm sure there's some unintended consequence out there somewhere. Whatever I find I'll be sure to post here.

                 

                The biggest thing that comes to mind is if the hidden file doesn't get closed for some reason prior to trying to update it with another version. If I were to send the updated version via email, when the user opens it in Go it will append a (1) or something like that if the original is still open. Then I've got a mess. But ultimately I'll be handling file updating via scripting and so will be able to check for open files, etc.

                • 5. Re: Hide a local file from user in FmGo?
                  wfgclapp

                  wfgclapp wrote:

                   

                  The biggest thing that comes to mind is if the hidden file doesn't get closed for some reason prior to trying to update it with another version. If I were to send the updated version via email, when the user opens it in Go it will append a (1) or something like that if the original is still open. Then I've got a mess. But ultimately I'll be handling file updating via scripting and so will be able to check for open files, etc.

                  which begs the question...how WOULD you remove files from a local Go device if you couldn't "see" them. You could need to remove for many reasons.

                  • 6. Re: Hide a local file from user in FmGo?
                    schamblee

                    To remove a file in FMGo file by script you export an empty file / or empty found count using the same filename.  FMGo automatically remove empty files.

                    1 of 1 people found this helpful
                    • 7. Re: Hide a local file from user in FmGo?
                      wfgclapp

                      schamblee wrote:

                       

                      To remove a file in FMGo file by script you export an empty file / or empty found count using the same filename. FMGo automatically remove empty files.

                      I was thinking more in the situation I describe above where you might not explicitly know the filename. For instance, a file is "hidden" by use of naming the file with a dot at the beginning. The file is open when you open a new version of the file from email. This new version from email will now be named with some sort of suffix appended to the name but since you can't see the file, you don't know exactly that the name is. This happens several times and now you have multiple files out there whose names you don't exactly know.

                       

                      It's those files I need to figure out how to clean off. Far as I know, FileMaker has no way of reading a list of files in a directory.

                      • 8. Re: Hide a local file from user in FmGo?
                        wfgclapp

                        wfgclapp wrote:

                         

                        It's those files I need to figure out how to clean off. Far as I know, FileMaker has no way of reading a list of files in a directory.

                        Or...would Get(DocumentsPathListing) do this? Looks like it.

                         

                        i spoke before I searched

                        • 9. Re: Hide a local file from user in FmGo?
                          rgordon

                          In the file that you want the user to use, have a script that runs at closing that will close the dot file or if you run an Exit Application step, it will close all open files.

                          1 of 1 people found this helpful
                          • 10. Re: Hide a local file from user in FmGo?
                            rgordon

                            One issue to consider, if you run an open script step with the dot file, I believe the dot file will appear in the list of recently opened files.

                            1 of 1 people found this helpful
                            • 11. Re: Hide a local file from user in FmGo?
                              wfgclapp

                              rgordon wrote:

                               

                              In the file that you want the user to use, have a script that runs at closing that will close the dot file or if you run an Exit Application step, it will close all open files.

                              Yes, I definitely have that. But that can be accidentally circumvented by force closes and such. Or not even that...a user might try to simply open the updated version from email without logging out of the current version first. 

                              • 12. Re: Hide a local file from user in FmGo?
                                wfgclapp

                                wfgclapp wrote:

                                 

                                wfgclapp wrote:

                                 

                                It's those files I need to figure out how to clean off. Far as I know, FileMaker has no way of reading a list of files in a directory.

                                Or...would Get(DocumentsPathListing) do this? Looks like it.

                                 

                                i spoke before I searched

                                 

                                Uh oh. Looks like a dot at front of filename hides the file from this listing as well.

                                 

                                So...I can see no way to remove a hidden file without knowing the exact filename. Besides deleting and reinstalling FMGo.

                                1 of 1 people found this helpful
                                • 13. Re: Hide a local file from user in FmGo?
                                  wfgclapp

                                  wfgclapp wrote:

                                   

                                  Uh oh. Looks like a dot at front of filename hides the file from this listing as well.

                                   

                                  So...I can see no way to remove a hidden file without knowing the exact filename. Besides deleting and reinstalling FMGo.

                                   

                                  Good news. Turns out that the function "DatabaseNames" will help here. Calling this function will return a list of all open FM files regardless whether hidden or not. Whereas Get(DocumentsPathListing) returns a list of all files open or not but excludes hidden files.

                                   

                                  This doesn't directly address the original point of this thread, but it will certainly be helpful in dealing with hidden files.

                                  • 14. Re: Hide a local file from user in FmGo?
                                    wfgclapp

                                    Another very viable option :

                                     

                                    Remember, my goal was to hide the DATA file from users in the FMGo launch center so they would always open the UI file and never the DATA file directly.

                                     

                                    Using a preceding dot in the filename strictly accomplishes this, though there are some resulting complications when dealing with a completely hidden file.

                                     

                                    But I have found what might be the best of both worlds. In the "FileMaker Network Settings" I can set my DATA file to "not display in the Launch Center". This will keep the DATA file from appearing in the "Recent" section of the launch center though it will still be found in the "Device" section. Since my users will almost always operate from the "Recent" section, I think this will be perfectly fine. So, the users are not confused, and I as a developer can deal with DATA file much easier than if it is hidden with the .filename.fmp12 convention.

                                     

                                    Good enough for now.

                                    1 of 1 people found this helpful