6 Replies Latest reply on Apr 11, 2014 2:31 PM by erolst

    Can Filemaker 13 Pro Advanced open a MAC finder window?

    dondea

      I have very little experience using Filemaker, so I apologize if I use basic (or incorrect) terminology!

       

      I'm using FM13 Pro Advanced. I have a 15,000+ database of consumer goods with the 12-digit UPC number as the unique identifyer for each product and related data regarding that product. I also have a folder with 15,000+ image.eps files of the products that are named with the unique UPC number. The 15,000+ images are stored in a folder on the same server that hosts the database. Everything is MAC based, including the server.

       

      In my database I have a container field which shows the image .eps file that is the result of a calculation for looking in the specific folder for the picture file name that matches the product UPC.

       

      Is there a way that filemaker can be programmed to go to and then open the image folder window where the picture files are stored and then highlight the specific image? It is basically a simple find command on a MAC, but I want filemaker to start the find relative to the image in the container field. Once the image file is highlighted in the finder window it can simply be dragged into an Indesign file.

       

      Thanks for any insight into this.

        • 1. Re: Can Filemaker 13 Pro Advanced open a MAC finder window?
          perren

          Sure. Use the "Open URL" script step with the following syntax:

           

          "file:///MyServerVolume/some/path/to/a/file/"

           

          Note the triple slash after "file:" - that's the key part of the trick.

           

          Hope that helps,

           

          --Perren

          • 2. Re: Can Filemaker 13 Pro Advanced open a MAC finder window?
            monkeybreadsoftware

            If you use our MBS FileMaker Plugin, you could use the function Files.RevealFile to show the item in the Finder/Explorer. Finder would even select it, so user knows which it is.

             

            https://www.mbsplugins.eu/FilesRevealFile.shtml

             

            or if you just need to show the folder, you could use Files.LaunchFile with path to folder:

             

            https://www.mbsplugins.eu/FilesLaunchFile.shtml

             

            Greetings

            Christian

            • 3. Re: Can Filemaker 13 Pro Advanced open a MAC finder window?
              dondea

              Perren, I have tried your syntax and just about every conceivable combination of pieces of it but I can't get this to work! 

               

              When I use     <open url "file:///ImageByUPC... >  nothing happens.  When I make it   < open url "/ImageByUPC... >  it opens a safari page saying the requested url can't be found.  I've tried using an applescript too, with no result.

               

              I know my inexperience is hurting me, and even the filemaker help guide says   "With AppleScript, you can pass images stored in container fields to other applications..."   but gives no specifics about the scripting.

               

              I'm attempting to just get the script to open the      ImageByUPC       folder in the finder, then I'll deal with it pointing to the correct image (a combination of two of my fields).

               

              Thank you for your input--I appreciate the help!


              • 4. Re: Can Filemaker 13 Pro Advanced open a MAC finder window?
                KylePutzier

                I have a Mac folder that contains a number of sub-folders that start with a number and then have some words after that (e.g. "4125 Some Words Here"). I needed FileMaker to open a folder that matched a number in a FileMaker field (e.g. "4125").

                 

                Here is what I did to accomplish that.

                 

                I set a variable ($ParentFolder) with the path to the main folder ("/Volumes/MyMainFolder/")

                I set a variable ($StartsWith) with the data from my FileMaker field ("4125")

                 

                Then run this Applescript (using the Perform Applescript script function) that calls a shell script. I found that a shell script is much, much faster than doing it all in Applescript. My parent folder contains a lot of sub-folders.

                 

                "do shell script \"open " & $ParentFolder  & $StartsWith & "*/\""

                 

                I do a bunch of other stuff in the actual FMP script, but this is the part that finds and opens the folder I'm looking for.

                 

                This is not exactly what you need, but it might spur a solution for you. Unix may contain the answer to your problem.

                 

                Kyle

                • 5. Re: Can Filemaker 13 Pro Advanced open a MAC finder window?
                  sporobolus

                  on 2014-04-10 13:52 dondea wrote

                  Is there a way that filemaker can be programmed to go to and then open the image folder window where the picture files are stored and then highlight the specific image? It is basically a simple find command on a MAC, but I want filemaker to start the find relative to the image in the container field.   Once the image file is highlighted in the finder window it can simply be dragged into an Indesign file.

                   

                  if you have a properly formatted HFS path to the file, it is as simple as this:

                   

                  tell application "Finder"
                     activate
                     reveal the_path
                  end tell
                  

                   

                  you don't describe the paths you are using; if you are constructing from

                  scratch note that HFS uses the format

                   

                  volume:folder:folder:filename.ext

                   

                  if you are converting from FileMaker path to HFS path, here is a help:

                   

                  <http://www.briandunning.com/cf/902>

                   

                  (i haven't tested this, but pointing to it is much faster than digging up some

                  old code of my own)

                  • 6. Re: Can Filemaker 13 Pro Advanced open a MAC finder window?
                    erolst

                    dondea wrote:

                    I know my inexperience is hurting me, and even the filemaker help guide says   "With AppleScript, you can pass images stored in container fields to other applications..."   but gives no specifics about the scripting.

                    While it's true that UNIX commands work faster than AppleScript, for your purposes a simple AppleScript should be sufficient (and sufficiently fast):

                     

                    Let ( [

                      path = YourTable::yourImagePath ; // or the same calculation you use to calculate the image path for the container

                      AS_path = Substitute ( path ; [ "imagemac:/" ; "" ] ; [ "filemac:/" ; "" ] ; [ "/" ; ":" ] )

                      ];

                      List (

                        "tell application " & Quote ( "Finder" ) ;

                          "activate" ;

                          "reveal " & Quote ( AS_path ) ;

                      "end tell"

                      )

                    )

                     

                    Use that in Perform AppleScript[].