Skip to main content
Inspiring
December 18, 2018
Question

Export book file (documents) to individual pdfs - retaining unique, assigned pdf export 'Save as' name

  • December 18, 2018
  • 1 reply
  • 2545 views

I posted a question related to this issue a while ago, but have not seen any further discussion.

Does anyone know of a script that can export Indesign files (ideally a group of book files) to pdf using the Export - 'Save as' name assigned/saved to the file?

Better still a script that can export individual files contained in multiple book files using the above file naming method?

MTIA

Steve

This topic has been closed for replies.

1 reply

Inspiring
December 20, 2018

Hi,

The following AppleScript can get you started. You will want to add details for how the PDF is to be saved.

--assuming a book is open and the files for the book are in the same folder as the book

tell application "Adobe InDesign CC 2018"

  set bookList to books

  set bookRef to item 1 of bookList

  set filePath to file path of bookRef as string

  set fileList to name of book contents of bookRef --gets names of the book's files

  repeat with i from 1 to length of fileList

  set thisFilePath to filePath & item i of fileList --add book's path to name of file

  set oset to offset of "." in thisFilePath

  set pdfFilePath to (text 1 thru oset of thisFilePath as string) & "pdf"

  set docRef to open file thisFilePath --open the file and export PDF

  tell docRef

  export format PDF type to pdfFilePath without showing options

  end tell

  close docRef saving no

  end repeat

end tell

Hope this helps.

Inspiring
December 21, 2018

HI 'S'

Thank you, I'm sure that will answer part of my goal. Sadly I'm not a scripter (I have 'fiddled' successfully amending bits of Java, but not applescript). I'll think about it over the xmas break and see how it works when I'm back in the office in January.

The filenaming process I use/need to employ doesn't seem to be widely used. In fact there was some talk of the facility being removed from InDesign 2019. I create/maintain a couple of hundred InDesign specification sheets (exported to pdf as finished item) which are incrementally numbered when updated. When I create a document it has the standard file name format from InDesign just using the Product name as the InDesign file name.

When I export that file to pdf the first time I append the file name with 'v01.01'. When I update that file (InDesign file overwritten and saved) and export the file again the Acrobat 'saved' file name is v01.01 which I then amend to v01.02.

Steve

Inspiring
December 21, 2018

Hi Steve,

both methods are also availbale for object Document.

In fact you'll find that insertLabel() and extractLabel() are there for nearly all kind of objects with InDesign.

Regards,
Uwe


Thanks Uwe,

It's about time I learnt about using Apple Script!

Regards, Steve