3 Replies Latest reply on Nov 22, 2009 9:31 PM by jla_1

    Finding containers without images



      Finding containers without images


      I've searched the forums but was unable to get an conclusive answer.  I have containers with referenced images, these are show in a portal row.  I import a csv with a list of students and matching images.  The images are stored on a local folder.  If Student A has img1.jpg, img2.jpg, & img3.jpg but the physical image 2 & 3 are not present in the folder due to editing, etc...FM still sees a file there, but does not display it because the reference is broken.  How can I search for all missing images and delete that reference/record since I'm assuming it's not really an empty container, just a broken one.

        • 1. Re: Finding containers without images

          There are a few ways to do this. The easiest way would be to use a plugin or maybe applescript to check if the file exists as you loop through the records.


          Another option would be to import into a global container field and error trap to see if the file imported correctly.


          Here is s thread that mentions both methods.




          • 2. Re: Finding containers without images

            Thanks.  I attempted to get this working, but am having trouble getting the first steps going.  I have already used the Mooplug to set the path to the images:


            Set Field [IMAGES::JPEGPATH; Moo_DialogFolder(IMAGES::JPEGPATH;True)]

            Set Variable [$$jpegpath; Value:IMAGES::JPEGPATH]


            I assuming since I have that path captured and the variable set I may be able to use that with the IMAGES::IMAGE1, the field with the name of the image to check if it exists in that folder.  Honestly I'm lost as to how to put it into motion using the mooplug FileExists.  I'm using a PC at this point so Applescript is not an option currently.  Thanks for any help. 

            • 3. Re: Finding containers without images

              For the benefit of others in the same predicament, this is what worked for me.


              • Go to Record/Request/Page[ First ]
              • Loop
              • Set Variable [ $$missing; Value:IMAGES::JPEGPATH & "/" & GetAsText ( IMAGES::IMAGE1) ]
              • Set Field [ IMAGES::MISSINGIMAGE; Moo_FileExists( $$missing) ]
              • Go to Record/Request/Page[ Next; Exit after last ]
              • End Loop



              The JPEGPATH was set by another Mooplug, Moo_Dialogfolder and set to global variable, then passed to the field JPEGPATH.  I then did a find on the field MISSINGIMAGE for '0' the value returned and deleted that found set.  Don't know if this was the best or most efficient way, but it worked.  If anyone has any input or tips on making this more efficient, please feel free to add.  Thanks Mr. Vodka for pointing me in the direction.