2 Replies Latest reply on Dec 21, 2010 11:33 PM by Kasyan Servetsky

    [MAC] How to open a "damaged" file

    Kasyan Servetsky Level 5

      Hi all,

      A while ago I wrote a script that opens all InDesign documents in the selected folder and exports them to interchange format.
      But a couple of days ago a guy reported me a problem he encountered trying to open this damaged InDesign file.
      When I open the file in UI, or by script with UserInteractionLevels.NEVER_INTERACT -- this dialog appears and I have to click OK to continue.

      Picture 1.png
      If I open it by script with UserInteractionLevels. INTERACT_WITH_ALL -- the following message pops up, I have to click OK as well but nothing happens: no inx file produced.

      Picture 2.png

      I tried to make use of this solution found on the neighbouring Photoshop scripting forum, but Apple Script silently refuses to open this file:

      tell application "Finder"
          set myFile to file "file001C_001G_U01_UP_101315_122_7.indd" of desktop
      end tell
      tell application "Adobe InDesign CS3"
          open myFile
      end tell

      Any ideas? I give up!


        • 1. Re: [MAC] How to open a "damaged" file
          sstanleyau Level 4

          I'm not sure of the problem, but the code you posted is probably not going to help. When you ask the Finder for the file, it returns a Finder reference. When you try to pass that to InDesign, all it does is pass it straight back to the Finder: you are, in effect, doing the same thing as double-clicking on a file in the Finder. Worse, it's asynchronous -- your script will move on to the next statement without waiting until the document is fully open.


          You should at least use:


          tell application "Finder"
              set myFile to (file "file001C_001G_U01_UP_101315_122_7.indd" of desktop) as alias
          end tell

          1 person found this helpful
          • 2. Re: [MAC] How to open a "damaged" file
            Kasyan Servetsky Level 5

            Thank you for your quick reply, Shane.
            I rarely use AS so know it rather superficially.