6 Replies Latest reply on Jan 20, 2015 9:03 AM by mtwalker

    How can I enter an image filename in a text field?

    folio

      Hi. I'm a visual artist and a beginner with Filemaker. I'm using it at home to catalog my drawings and paintings and keep info on my contacts. I have tables for Pictures, Contacts and Exhibitions with some linking between them. My question is, how can I automatically enter the filename of each image (.jpg) into a text field in the same record in the Pictures table?

        • 1. Re: How can I enter an image filename in a text field?
          jbrown

          Hi.

          You can use GetContainerAttribute( yourcontainerfield ; "filename"). That will put the name of the file into that text field.

          How are you entering the picture? A script step? Drag and drop? Right  clicking on the container field to put the picture in?

           

          I'd use this in a script step that imports the picture into the container field and then sets the file name into the text field. Or you could make it a script trigger. There are a lot of possibilities. Let me/us know if you'd like next steps on that.

          1 of 1 people found this helpful
          • 2. Re: How can I enter an image filename in a text field?
            folio

            Thank you. I will try that.

             

            I have 2 books for very old versions of FM Pro, one by Steven Schwartz and one by Chris Kubica which have been a bit of help. I was using FM years ago and then not for a long while and have just recently picked it up again, to find that all the old entries were still there and converted to v12 without any problems.This has encouraged me to keep at it and bring it up to date. I had some scripts in the old one and can't remember how I did them ... it's coming back little by little.

             

            I will let you know how it goes.

            • 3. Re: How can I enter an image filename in a text field?
              mtwalker

              You can use an AutoEnter calculation on the filename text field. Just set the calculation to be the field name of the container.

              • 4. Re: How can I enter an image filename in a text field?
                folio

                I did "auto-Enter" for the field which is called "Image filename", the container field is called "Image".

                 

                GetContainerAttribute ( Image ; "filename" )

                 

                It worked!! At first nothing happened. I tried it without the quotes around "filename" and it said "Specified field not found" so I put the quotes back and inserted a pic in a new record, and it put the filename in the field at the same time the pic was inserted. This saves some tediousness, and it doesn't interfere with the records I'd already done (tried it on an old backup first). Thanks ever so much!

                • 5. Re: How can I enter an image filename in a text field?
                  folio

                  Thanks for all the help!

                  • 6. Re: How can I enter an image filename in a text field?
                    mtwalker

                    In the settings for the AutoEnter calculation, if the "Do not replace existing value of field (if any)" is checked, the field won't update if for some reason you enter a new image in the container field. If you uncheck it, it will.