7 Replies Latest reply on Dec 29, 2015 8:11 AM by stre0185

    Hoping for a quick fix to broken links

    stre0185

      Hi,

       

      I accidentally changed the name of the folder that a container field references. It's configured to store data externally. The field now displays, "The file cannot be found [name of file]" in each record. I changed the folder back to its original name, closed the database, and restarted the computer (Mac), but the links are all still broken. Any suggestions for fixing other than individually relinking all the records?

       

      Thanks,

      Stephen

        • 1. Re: Hoping for a quick fix to broken links
          Mike_Mitchell

          I've had this issue before (prior to realizing any sort of monkeying with external container directories causes havoc). I managed to figure out a script that allows you to set the container references back. It's relatively simple to do; just was a big tricky to figure out.

           

          Here's what you do:

           

          Set Variable [ $path ;

          Value:

          Let ( [

          field = GetAsText ( yourContainerField ) ;

          detectString = Case ( PatternCount ( field ; "FILE:" ) ; "FILE:" ; PatternCount ( field ; "PDF :" ) ; "PDF :" )

          ] ;

           

          "RC_Data_FMS/[remainderOfPath]/" & Right ( field ; Length ( field ) - Position ( field ; detectString ; 1 ; 1 ) - 4 )

           

          )

          ]

           

          Insert File [ yourContainerField ; $path ]

           

          Lather, rinse. and repeat for each record / field. (I used a looping script.)

           

          HTH


          Mike

           

          P. S. Just to drive the point home: Never, under any circumstances, make any sort of OS-level modifications to the external container directories or files. You will break the links between FileMaker and the assets and ... well, you know.  

          • 2. Re: Hoping for a quick fix to broken links
            stre0185

            Hi Mike,

             

            Thanks for the help and sorry for the long delay. Had to wait until after the holiday to attempt this. I haven't been able to get the script to work. When I run it, I get the error message

             

            "The file “:612,792” could not be found and is required to complete this operation."

             

            This happens regardless of what record I'm in or working in the original database or a copy. I'm sure it's something boneheaded on my part, but I can't figure out what. Any suggestions?

             

            Thanks,

            Stephen

            • 3. Re: Hoping for a quick fix to broken links
              Mike_Mitchell

              What does GetAsText ( ContainerField ) return?

              • 4. Re: Hoping for a quick fix to broken links
                stre0185

                Hi Mike,

                 

                Blue is what is returned for every record, black is unique info of the missing file.

                 

                size:612,792

                image:FolderName/FileName

                imagemac:/Directorypath

                • 5. Re: Hoping for a quick fix to broken links
                  Mike_Mitchell

                  Then you need to modify the calculation to extract the correct path from that information. You would do something like this:

                   

                  field = GetValue ( GetAsText (containerField ) ; 2 ) (or 3 for imagemac)

                  detectString = "image:" (or "imagemac:")

                   

                  and then

                   

                  "RC_Data_FMS/[path]/" & Right ( field ; Length ( field ) - Position ( field ; detectString ; 1 ; 1 ) - 6 ) (or 9 for imagemac)

                   

                  You'll need to identify which one is the correct path to choose between image: and imagemac:, but that should do you.

                  • 6. Re: Hoping for a quick fix to broken links
                    stre0185

                    Thanks! That's what I needed. You also helped me clue in that I needed to adjust the formula for the path because I'm not using the server version.