2 Replies Latest reply on Feb 12, 2015 1:31 PM by kermy812

    Applescript relink all to a specific folder

    kermy812 Level 1

      I'm somewhat ok with scripting, but having problems.

       

      I have a script that I'd like to relink missing links to a certain folder, but it's not linking when I run the script.

      Any idea what I have wrong here? This is the portion out of my much bigger script I'd like to fix:

       

      tell application "Adobe InDesign CS6"

        tell active document

        set allLinks to every link whose status is link out of date

        repeat with thisLink in allLinks

        relink thisLink to POSIX file path "Volumes:Documents:WORKING:As Needed Items & Scripts:_Rugs:"

        end repeat

        end tell

      end tell

       

      I have hundreds of indd files to deal with monthly from my customer. Instead of the customer sending me the same 7-800 links all the time, I'd like to just run this script and relink all to a specific folder where I have all their links archived.

        • 1. Re: Applescript relink all to a specific folder
          greenrookie Level 2

          Hi, Try this:

           

          tell application "Adobe InDesign CS6"

              tell active document

                  set allLinks to every link whose status is link out of date

                  set myPath to "Volumes:Documents:WORKING:As Needed Items & Scripts:_Rugs:"

                      repeat with thisLink in allLinks

          try

                          set currFileName to name of thisLink

                          set newPath to myPath & currFileName

                          relink thisLink to newPath as alias

          end try

                      end repeat

              end tell

          end tell

           

           

          gr

          • 2. Re: Applescript relink all to a specific folder
            kermy812 Level 1

            Thanks greenkookie! That work perfect. I did make 1 minor change from

             

            set allLinks to every link whose status is link out of date

            to

            set allLinks to every link whose status is link missing