I have a hotfolder (Folder Action) that opens dropped files, exports as PDF and then should close but it does not. If I remove the export function it works just fine.
tell application "InDesignServer"
set myDoc to open the_dropped_file_path as string
export document 1 format PDF type to myFile & "_lowres.pdf" as string using "[Smallest File Size]"
if (count documents) is not equal to 0 then
close document 1 saving no
display dialog "No documents are open."