2 Replies Latest reply on Dec 22, 2010 1:35 PM by justjoker

    Script to replace picture after annotation



      Script to replace picture after annotation


      Hello, guys

      I'm new in script writing. Could somebody help me in writing 2 scripts to do the following:

      1.  - Grab a part of the screen with Apple's Grab;

           - Insert the picture in the Container.

      2.  - Export picture from the Container to the Desktop (it opens in Preview for annotation);

           - Replace the old picture with annotated one in the Container;

           - Delete the picture from Desktop.

      Thank you,


        • 1. Re: Script to replace picture after annotation

          Don't know how to do part 1, but it likely can be done with an apple script. How to specify what part of the screen you want to capture could be a problem. You also can likely do the Screen capture manually, save it to a file and then insert the file into your container either manually or with a script.

          It's possible to do this exactly as described, but you can also export the picture to temporary items and then you won't have to delete it.

          You can specify the location to which you want to export the file in a variable first, then use that variable in the Export Field Contents step to export it to the location specified in the variable. After you edit and save the image file, a script can use this same path in the variable to insert the image back into the container field.

          To delete a file, you can use a second call of Export Field Contents to the same file path, but don't specify a field to export.

          You can also use a store by reference option when inserting the original image and not need to re-insert the edited image though now your image is stored externally to FileMaker so you then have to keep track of these additional files.