13 Replies Latest reply on Jan 11, 2010 6:40 AM by mrvodka

    Exporting photo-Enlarge photos

    CraigFiore

      Title

      Exporting photo-Enlarge photos

      Post

      Hello,

      I am trying to wright a script to Export my photos to a certain location. The location will be the same folder on our server every time and I want to do this with out a dialog box. 

       

      The reason I am doing this is because, when it is exported, FM will read the new exported file and I am able to create a script to enlarge the photo in a preview window for better viewing.

       

      The location is: afp://Celoseal Server._afpovertcp._tcp.local/Documents/Pictures/ OR file:///Volumes/Documents/Pictures/

      I am hoping when we are not on our network we will be able to still view the preview through the internet off the server through our VPN.

       

      Incase you are wondering, my overall script will:

      Insert a picture to "Picture 1" (field name)

      then

      Export Field Content to location above.

      If the file name is already taken it will rename the photo and re-Insert the photo to "Picture 1" (Im not sure how to do this either) 

       

      The main goal is to be able to enlarge the photo for better view. I really don't need to save the photos as long as they are in FM. We try to keep the photos on the smaller size because they are used in reports that are emailed to clients a we don't want the file to be too big.

       

      All help is appreciated.

       

      Craig 

        • 1. Re: Exporting photo-Enlarge photos
          philmodjunk
            

          If all you are trying to do is view the photos in an enlarged format, try this approach:

           

          Create a new layout and place the container field on this layout--resized to be the larger format you want.

           

          Use a button/script to either switch to this layout or use New Window to view the image in a new pop-up window.

           

           

          • 2. Re: Exporting photo-Enlarge photos
            CraigFiore
              

            That sounds much easier. :smileyhappy:

            Ive never created a pop  up window. Where do i find that? 

            • 3. Re: Exporting photo-Enlarge photos
              philmodjunk
                

              As stated in my last post, you'd use the New Window command to open a new window. You'll find parameters where you can specify the dimensions of the window.

               

              In a Mac environment, you'd just do this.

               

              New Window[ set your parameters for windows size, location and window name here ]

              Go To Layout [Enlarge picture layout]

              Show/Hide Status Area [Hide]

              Allow User Abort[off]

              Loop

                Pause/resume script

              End Loop

               

              The loop keeps the pop up "modal" so that the user can't lose the pop up window by clicking the window behind it. You'll either add a button that both halts the paused script and closes the window or you use Custom Menus to set things up so that Close window in the file menu runs this script.

               

              On windows systems, you have to add an adjust window step to set your background window out to a size equal to your desktop and include a maximize window step when you close the pop up. Otherwise a bug in Filemaker will cause the background window to resize in annoying and confusing ways.

              • 4. Re: Exporting photo-Enlarge photos
                CraigFiore
                  

                Thanks!

                 

                I like the idea of closing the script when closing the window, with the red button in the top left corner.

                 

                I changed the script to:

                New Window[ set your parameters for windows size, location and window name here ]

                Go To Layout [Enlarge picture layout]

                Show/Hide Status Area [Hide]

                Allow User Abort[off]

                Loop

                   Haut Script

                End Loop 

                 

                Is this correct? 

                • 5. Re: Exporting photo-Enlarge photos
                  philmodjunk
                    

                  As long as you have a way to halt the infinite loop at the end of the script.

                   

                  Use this script:

                   

                  Close Window [Current Window]

                  Halt Script

                   

                  The halt script step will terminate the paused/trapped in an infinite loop script that made the pop up "modal".

                   

                  If you have Filemaker pro advanced, you can set up a custom menu that replaces normal File | Close with the above script. If you don't have FMP advanced or this is part of a run time file, you'll have to add a button on your layout to run the script.

                  • 6. Re: Exporting photo-Enlarge photos
                    CraigFiore
                      

                    Works Great. 

                    Quick question.  Is there a way to tell if a script is still open?

                    • 7. Re: Exporting photo-Enlarge photos
                      philmodjunk
                        
                      1. You'll see at least a "continue" button in the status area at the top of your screen. (You may have to expose the status area if it's hidden.)
                      2. Many menu options that are normally enabled will be greyed out/disabled.
                      • 8. Re: Exporting photo-Enlarge photos
                        thumper
                           I have done this as well, difference is i have 10 photo container fields for each record, and would like each one to open in the enlarge photo layout, im guessing there would need to be a calculation code for the enlarged photo layout to determine which photo to show in the elarged photo container field, but i have no idea where to start with that.
                        • 9. Re: Exporting photo-Enlarge photos
                          mrvodka
                             No you should have the photos in a related photos table. Then you can use a Go to Related Records ( w/ new window option showing only the related records ) to show those related photo records in the new window. Then you can either use the native navigation on the status toolbar or create natvigation buttons to go to prev and next records to scroll through the photos..
                          • 10. Re: Exporting photo-Enlarge photos
                            thumper
                              

                            I tried to do what i think you mean, by creating a new table, with fileds:

                             

                            Photo ID : Number

                            Photo Main : Container

                            Photo2: Container

                            Photo3 : Container

                            Photo4: Container

                            Photo5: Container

                             

                             

                            and I then set a relationship between the Photo ID field and the HP ID field which is a field that is in my "HP MAin" table which is where all my main records are stored. Now im lost again lol

                             

                             

                            • 11. Re: Exporting photo-Enlarge photos
                              mrvodka
                                

                              You only need 2 fields.

                              ID, and Photo.

                               

                              Each photo will be its own record.

                              • 12. Re: Exporting photo-Enlarge photos
                                thumper
                                   ok , but what i mena is for each animal record there are 5 photo fields, i re-created these fields in a table called "Animal Photos" and added a relationship from HP ID (animal Record) to the Photo ID, but when i enterbrowse mode and view the records already added in the database and go to the layout for the new table created none of the previouse photos show up?
                                • 13. Re: Exporting photo-Enlarge photos
                                  mrvodka
                                    

                                  No you are still missing the point. There shouldnt be 5 fields. There should only be 1 for the photo with 5 related records. If you need to take those already entered into the system, then use a script to move them over to new records.

                                   

                                  So in the end there will be 3 fields in your photo table: Photo ID, HP ID, and Image

                                   

                                  There will also be 5 reords for that animal.