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