2 Replies Latest reply on Jul 17, 2009 8:53 AM by metroart

    Open Image File from Script?

    metroart

      Title

      Open Image File from Script?

      Post

      I'm creating a Filemaker 10 solution in Windows for my townhistorical society to catalog its collection of photos.

       

      I'm using Filemaker’s Import folder feature to bring batchesof JPEG files (each with a thumbnail, filepath and file reference) into the database.

       

      Filemaker lets me open the JPEG image directly in thedefault JPEG application (e.g. Picasa Photo Viewer) by right-clicking thefilepath field and selecting Open File from the menu.

       

      BUT how can I do this from a SCRIPT? – so I can allow myusers, for example, to open the file in Picasa simply by clicking on thethumbnail image.

       

      The only way I know is to use a dynamic file variable (e.g. $filepath)with the Export Field Contents script step. BUT this has one BIG disadvantage –you can't open the image file directly – you can only export the contents ofthe JPEG to a COPY of the JPEG, which is rather confusing to the user.   

       

      Is there any way to have a script open the image fileitself, rather than a copy?

       

        • 1. Re: Open Image File from Script?
          mrvodka
            

          You should be able to use an Open URL. If the jpg is embedded, then a normal Open URL should work. If it is referenced, then you will have to parse out the file path to use Open URL.

           

          Something like:

          Let ( path = GetValue ( GetAsText ( YourContainer ); 3 ); Middle ( path; Position ( path; "/"; 1; 1 ) +1; Length ( path ) - Position ( path; "/"; 1; 1 ) ) )

          • 2. Re: Open Image File from Script?
            metroart
              

            Thanks! You just solved a big headache.

             

            >If the jpg is embedded, then a normal Open URL should work. If it is referenced, then you will have to parse out the file path to use Open URL.

             

            Even though my jpg is referenced, a normal Open URL works just fine, since Filemaker already supplies the full filepath as part of the Import Records script step.