Hi all,
I have a script that opens InDesign documents and exports them to PDF.
I have a few users that are using this script. The idea is that InDesign runs in the background and allows the user to keep working in other programs. This works fine for most users, however there are some where InDesign jumps to the foreground when it opens each document.
I turn off user interaction as I start, and turn it back on when I finish, however it still doesn't seem to solve the issue. I've also attempted to 'hide' InDesign with system events, on those computers I'm having trouble on, it still happens.
I have ALSO tried turning the InDesign window off, also no help.
Anyone got any thoughts?
Here's a simplified version of the script.
(InDesign CS5 and Snow Leopard)
set strFolderPath to (choose folder with prompt "Choose InDesign documents folder") as string
set strOutputFolder to choose folder with prompt "Choose PDF export folder"
set lstSelectedFiles to paragraphs of (do shell script "ls " & (quoted form of (POSIX path of (strFolderPath))))
setUserInteration(false)
tell application "System Events" set visible of process "Adobe InDesign CS5" to false end tell
set intIndex to 0 repeat with strFilepath in lstSelectedFiles set intIndex to intIndex + 1 set strCurrentFilePathHFS to (strFolderPath & (strFilepath as string) as string)
tell application "Adobe InDesign CS5"
open strCurrentFilePathHFS without showing window export document 1 format PDF type to ((strOutputFolder & intIndex & ".pdf") as string) without showing options close front document saving no end tell
end repeat
setUserInteration(true)
on setUserInteration(blnUserInteraction) tell application "Adobe InDesign CS5.5" tell script preferences if blnUserInteraction then set user interaction level to interact with all else set user interaction level to never interact end if end tell end tell end setUserInteration
|