Indesign CS5.5 Relink Script needs help


hi, i'm trying relink images in indesign cs5.5 file different server using script. have far, when run script errors , can't relink because "either file not exist, not have permission, or file may in use application". know how make script work? i'm new scripting.

 

here script have:

 

tell application "adobe indesign cs5.5"

          tell document 1

                    set linklist to links

                    set errinfo to "" -- we'll display error if can't relink item

  -------

                    repeat with x in linklist

                              if (x's status) is not normal then -- check link has error

  -- should return applescript path ":" separators

                                        set linkpath to (x's file path) as string

  -------

                                        if "volumes/calendars_2013 fpo" is in linkpath then

                                                  set applescript's text item delimiters to "volumes/calendars_2013 fpo"

                                                  set linkpath to (linkpath's text items) -- create list of text items

                                                  set applescript's text item delimiters to "volumes/calendars_2013"

                                                  set linkpath to (linkpath as string) -- concatenate new path

                                                  set applescript's text item delimiters to "" -- reset tids

  -------

                                                  try

  -- need make our string (path) alias path

  relink x to alias linkpath

  -------

                                                            try

  update x -- can helpful

                                                            end try

                                                  on error err

  -- we'll store link name if error occurs

                                                            set errinfo to (errinfo & return & x's name)

                                                  end try

                                        end if

                              end if

                    end repeat

  -------

  -- if error occurs while trying relink, we'll display it

                    if (count errinfo) > 0 then display dialog ("can't relink:" & errinfo)

          end tell

end tell

 

 

--hector


hi,

 

'volumes/...' posix path. file path on mac returns hfs path. try hfs: "calendars_2013 fpo:" instead of posix: "volumes/calendars_2013 fpo"



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support