specify folder instead of desktop...

can anyone help me with this again??

i managed to export pdf using indesign, but it saves it to my desktop… how can i get it in a specific folder???

set deskPath to path to desktop as Unicode text
			tell application "Adobe InDesign CS3"
				set screenSettings to PDF export preset "[Smallest File Size]"
				set page range of PDF export preferences to all pages
				set docName to name of document 1
				if docName ends with ".indd" then
					set docName to text 1 thru -6 of docName
				end if
				export document 1 format PDF type to (deskPath & docName & ".pdf") using screenSettings without showing options
			end tell

tx !!

The parent folder path of the PDF file is specified here:


set deskPath to path to desktop as Unicode text

So you need to change it according to your requirements:


set deskPath to "DandyDisk:Users:martin:Documents:" as Unicode text

HTH!

Try this, just specify the path in the initial set statement and off you go.

set savePath to "your:path:here"
tell application "Adobe InDesign CS3"
	set screenSettings to PDF export preset "[Smallest File Size]"
	set page range of PDF export preferences to all pages
	set docName to name of document 1
	if docName ends with ".indd" then
		set docName to text 1 thru -6 of docName
	end if
	export document 1 format PDF type to (savePath & docName & ".pdf") using screenSettings without showing options
end tell

Just add the folder name along with a “:” like this:


set deskPath to (path to desktop as Unicode text) & "FolderName:"

Regards,

Craig

And one other suggestion

property savePath : missing value
try
	savePath as alias
on error
	set savePath to (choose folder with prompt "Where should PDFs be exported to") as Unicode text
end try
tell application "Adobe InDesign CS3"
	set screenSettings to PDF export preset "[Smallest File Size]"
	set page range of PDF export preferences to all pages
	set docName to name of document 1
	if docName ends with ".indd" then
		set docName to text 1 thru -6 of docName
	end if
	export document 1 format PDF type to (savePath & docName & ".pdf") using screenSettings without showing options
end tell

This will prompt you initially for the savePath the first time you run the script. On subsequent runs it will use the same path unless it no longer exists and then you will be prompted to choose the path again.

hmmm…tx everybody!!!..

it’s only very strange, only Craig Williams’ solution works fine… with all the others indesign stops after importing my xml…
the last example of James Nierodzik asked for a folder indead, but did not generate a pdf…

i also supposed that i had to use a fullpath…but it just won’t start then… straaaange

:rolleyes: oops… just tested James Nierodzik’s script again… and it works just fine actually… sorry but tx anyway!!! think this is a very good solution for usablility… tx

Glad to see it works for you :smiley: