Need help in Scripting Indesign CS6 to PDF

I’m using this line:

open mgThisItem without showing window

but I get a message “no docs are open”

can someone please help me

try

			open mgThisItem without showing window
			
			set mgDocName to name of active document
			
			set text item delimiters of AppleScript to ".indd"
			
			set mgShortName to text item 1 of mgDocName
			
			set targetFolderPath to my createFolder(mgShortName)
			
			set text item delimiters of AppleScript to ""
			
			set mgPackageFilePath to targetFolderPath & mgShortName as string
			
			set mgProofFilePath to mgPackageFilePath & ".pdf" as string
			
			set properties of PDF export preferences to properties of PDF export preset "[Smallest File Size]"

Hi,

try this:

set mgThisItem to choose file
set targetFolderPath to path to desktop as string
set mgShortName to do shell script "FILENAME=$(basename " & quoted form of POSIX path of mgThisItem & ");NOEXT=${FILENAME%.*}; echo $NOEXT"
set mgProofFilePath to targetFolderPath & mgShortName & ".pdf" as string

tell application "Adobe InDesign CS6"
	try
		set thisDoc to open mgThisItem without showing window
		export thisDoc format "Adobe PDF" to mgProofFilePath using "[Smallest File Size]"
		close thisDoc saving no
	on error theError
		display dialog theError
	end try
end tell

Hope this helps,
Nik

Thank you Nik, it did help

Can I open a PDF with out window?

I try the following, but it’s not working
Can you please help me

tell application "Adobe Acrobat Pro"
	
	
	repeat with myDoc from (count myFilelist) to 1 by -1
		
		
		set myCurrentFile to item myDoc of myFilelist
		
		open myCurrentFile with invisible
		
		
		
	end repeat
	
end tell

thank you,

this thread may help

http://macscripter.net/viewtopic.php?id=31651