PDF to the same folder

Hi, I’m a noob to Applescripting and trying to work my way through all the great advise on this site.

I’ve found different parts of the script I want to create but really struggle to combine them.

Basically I’d like the script to find an InDesign with the same folder then PDF it into that same folder?

Is that possible and can anyone give me any pointers please?

Cheers
Rich

So far I have the following:



set x to path to me
tell application "Finder"
	set tFile to (file "template.indd" of (container of x)) as alias
end tell

tell application "Adobe InDesign CC 2015"
	open tFile
	
	set _NoCrops to PDF export preset "[Press Quality]"
	set _dest to path to me as string
	set _Name to name of active document as string
	
	tell active document
		export format PDF type to (_dest & _Name & " - No Crops X" & ".pdf") using _NoCrops without showing options
	end tell
	
	close active document saving yes --or no
	
end tell


I don’t get an error, so I assume its correct. The script appears to open and close the indesign file, however I get no PDF. I am assuming its the destination as when changed to desktop it all works.

I’d really like to get this to save in the same folder that the indesign file.

Any help greatly appreciated.

Hi,

first of all, welcome to MacScripter.

Second of all, please post questions regarding AppleScript into the AppleScript | OS X forum. AppleScript Studio is an old developer environment in Xcode.

The destination folder is the container of the script


set x to path to me
tell application "Finder"
	set destinationFolder to container of x as text
	set tFile to (file "template.indd" of folder destinationFolder) as text
end tell

tell application "Adobe InDesign CC 2015"
	open tFile
	
	set _NoCrops to PDF export preset "[Press Quality]"
	set _Name to name of active document as string
	tell active document
		export format PDF type to (destinationFolder & _Name & " - No Crops X" & ".pdf") using _NoCrops without showing options
	end tell
	
	close active document saving yes --or no
	
end tell


Great thank you. Works a treat.

Sorry about that, was following a lead from previous thread.

My next issue lies with updating links. Would you mind giving me a pointer there please? I have the following:



set x to path to me
tell application "Finder"
	set destinationFolder to container of x as text
	set tFile to (file "template.indd" of folder destinationFolder) as text
end tell

tell application "Adobe InDesign CC 2015"
	open tFile
	
	tell document 1
		set linkList to every link
		repeat with aLink in linkList
			if status of aLink is link out of date then
				update aLink
			end if
		end repeat
	end tell
	
	set _NoCrops to PDF export preset "[Press Quality]"
	set _Name to name of active document as string
	tell active document
		export format PDF type to (destinationFolder & _Name & " - No Crops X" & ".pdf") using _NoCrops without showing options
	end tell
	
	close active document saving yes --or no
	
end tell


I could be completely wrong but this is what comes of trying to cobble code together.

Cheers

Sorry I’m not that familiar with Indesign