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.
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!
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
Thank you for your quick reply, Shane.
I rarely use AS so know it rather superficially.