how to open an InDesign file and supress messages?

Hi folks,

I’ve got a script that will go to a folder and print all the InDesign files within that folder to a specified preset and it’s working great except for…

when a file is opened and has modified/missing links or a missing font the whole enchilada just dies right there. I’ve looked everywhere I can think of and just can’t find a way to supress error messages upon opening a file.

Is there a way to do this?

Thanks in advance.
Bob

First let me say that i’ve only just started with this application, I saw your post at Adobe whilst trying to pick up a few things myself. Here is what I think you were after. Just un-comment your print line.

set inputFolder to choose folder with prompt "This script will print all InDesign files in the specified folder using a print preset named LowResLaser." without invisibles
--
tell application "Finder"
	set filesList to (files in inputFolder whose name extension is "indd" or creator type is "InDn")
end tell
--
tell application "Adobe InDesign CS2"
	set user interaction level of script preferences to never interact
end tell
--
repeat with aFile in filesList
	set fileIndex to 0
	tell application "Finder"
		set theFile to aFile as alias
		set theFileName to name of theFile
	end tell
	tell application "Adobe InDesign CS2"
		activate
		open theFile
		-- print active document using "LowResLaser" without print dialog
		close active document saving no
	end tell
end repeat
--
tell application "Adobe InDesign CS2"
	set user interaction level of script preferences to interact with all
end tell

Hi Mark and thanks for the try. It still fails on a modified image though (I didn’t try the fonts but am assuming that window would still pop up as well).

I like what you did to build the file list better than what I did though so I’m going to keep that :stuck_out_tongue:

As for the interaction level I think yours is doing what mine was except you split that into two tells to InDesign. I’m not sure if that makes a difference or not as I’m still learning this too, but logically I think they’re doing the same thing…?

Does anyone know if the Interaction level simply doesn’t work with the open command from InDesign? That seems to be the issue and I don’t know if it can be gotten past or not.

Thanks all,

Bob

It looks like this may have its own commmand but im not familiar with how this works yet take a look at the Preference Suite for “alert missing images” your solution may require this.

Hi Mark,

It was a good thought, but the reference guide says that option is for creating a report listing the missing images. It’s a boolean with no other controls other than make a report/don’t make a report.

I’ve gotten some responses on the Adobe board as well, it seems I’ve either stumped a few people or this simply can’t be done in AppleScript. :frowning:

Here’s my current script:

set inputFolder to choose folder
display dialog ("This script will print all InDesign files in the specified folder using a print preset named LowResLaser.

Make sure your print preset is created correctly, pointed to the correct printer and that the paper feed option is manually set to the correct tray.")
tell application “Finder”
set filesList to (files in inputFolder whose name extension is “indd” or creator type is “InDn”)
end tell

tell application “Adobe InDesign CS2”
set user interaction level of script preferences to never interact
repeat with aFile in filesList

	set fileIndex to 0
	
	tell application "Finder"
		set theFile to aFile as alias
		set theFileName to name of theFile
	end tell
	open theFile
	--		set user interaction level to never interact
	--		set user interaction level of script preferences to never interact
	print active document using "LowResLaser" without print dialog
	close active document saving no
end repeat

end tell

Hi Guys
I just found your thread while trying to solve the same prob.
this works for me (CS2)

tell application "Adobe InDesign CS2"
	set user interaction level of script preferences to never interact
	open file "Macintosh HD:Users:aUser:Desktop:aTestofAbsence1.indd"
	tell document 1
		set theFonts to properties of every font
		set theMissingFonts to {}
		set theNotMissingFonts to {}
		repeat with thisFont in theFonts
			if (status of thisFont) as text is "not available" then
				set theMissingFonts to theMissingFonts & name of thisFont
			else
				set theNotMissingFonts to theNotMissingFonts & name of thisFont
			end if
		end repeat
		set theLinks to properties of every link
		set theMissingLinks to {}
		set theNotMissingLinks to {}
		repeat with thisLink in theLinks
			if (status of thisLink) as text is "link missing" then
				set theMissingLinks to theMissingLinks & name of thisLink
			else
				set theNotMissingLinks to theNotMissingLinks & name of thisLink
			end if
		end repeat
end tell
	close document 1 saving no
end tell

I ran across this issue when creating a couple of batch processes and came up with an UI solution. I place a line “my modalStateTrue” after opening a document so that the default button pushes are done after the doc opens.

on modalStateTrue()
	tell application "Adobe InDesign CS2"
		repeat
			if modal state is true then
				delay 2
				tell application "System Events"
					keystroke return
				end tell				
			else
				exit repeat
			end if
		end repeat
	end tell
end modalStateTrue