0 Replies Latest reply on Jan 24, 2012 3:45 PM by gtomps@lm

    Find unplaced text files and then place in document

    gtomps@lm

      I've used this script for some time, I'm pretty sure it originated out of these forums.  I'm hoping to modify it so that when the list of non placed files appears rather than revealing the file in the finder, to have it load into the indesign curser to be placed in the active document. 

       

      set myUnplacedFiles to {}

      set myChosenFiles to false

       

      tell application "Finder"

                set myFolder to (choose folder)

                set myFinderFilenames to name of document files of myFolder

      end tell

       

      tell application "Adobe InDesign CS5.5"

        activate

                tell active document

                          set myID_LinksNames to name of links

       

                          repeat with i in myFinderFilenames

                                    set myTest to «class ktxt» of ((i as string) as record)

                                    if i is not in myID_LinksNames then

                                              set end of myUnplacedFiles to i

                                    end if

                          end repeat

                          if myUnplacedFiles is not {} then

                                    set myChosenFiles to choose from list myUnplacedFiles with prompt "These files are not placed. Select one and click OK to display it in the Finder or Cancel to continue working in InDesign."

                          else

                                    display dialog "All files of this folder seems to have been placed" buttons {"OK"} default button "OK"

                          end if

       

                end tell

      end tell

       

      if myChosenFiles is not false then

                tell application "Finder"

        activate

                          reveal file ((myFolder as string) & (item 1 of myChosenFiles as string))

                end tell

      end if