Skip to main content
Participant
January 5, 2012
Answered

Create separate indesign documents for each page of a document

  • January 5, 2012
  • 2 replies
  • 23256 views

I am converting a print indesign file for use with dps. The problem is DPS wants individual files for each page. Is there a script to take each page and save as an indesign file?

This topic has been closed for replies.
Correct answer myDwayneSmith

G'day

You could start with something like this :

tell application "Adobe InDesign CS4"

    set enable redraw of script preferences to false

    activate

    set dsDoc to active document

    set dsDocProps to properties of document preferences of dsDoc

    set pages per document of dsDocProps to 1

    set dsFilePath to (full name of dsDoc) as text

    set text item delimiters of AppleScript to "."

    set dsFilePath to text 1 thru text item -2 of dsFilePath

    set text item delimiters of AppleScript to ""

    set dsPageCount to (count of pages of dsDoc)

    repeat with w from dsPageCount to 1 by -1

        set dsNewDoc to make new document with properties {document preferences:dsDocProps}

        duplicate page w of dsDoc to after page 1 of dsNewDoc

        set active document to dsNewDoc

        delete page 1 of dsNewDoc

        save dsNewDoc to (dsFilePath & "_" & w & ".indd")

        close active document

        delay 1

    end repeat

    close dsDoc saving no

end tell

m.

Message was edited by: myDwayneSmith

Sorry,  just posted this before seeing the 5.5 thing — should still work if you update the version number in the first line.

You might need to change "set dsFilePath to (full name of dsDoc) as text" to "set dsFilePath to (full name of dsDoc) as string"

2 replies

myDwayneSmithCorrect answer
Inspiring
January 6, 2012

G'day

You could start with something like this :

tell application "Adobe InDesign CS4"

    set enable redraw of script preferences to false

    activate

    set dsDoc to active document

    set dsDocProps to properties of document preferences of dsDoc

    set pages per document of dsDocProps to 1

    set dsFilePath to (full name of dsDoc) as text

    set text item delimiters of AppleScript to "."

    set dsFilePath to text 1 thru text item -2 of dsFilePath

    set text item delimiters of AppleScript to ""

    set dsPageCount to (count of pages of dsDoc)

    repeat with w from dsPageCount to 1 by -1

        set dsNewDoc to make new document with properties {document preferences:dsDocProps}

        duplicate page w of dsDoc to after page 1 of dsNewDoc

        set active document to dsNewDoc

        delete page 1 of dsNewDoc

        save dsNewDoc to (dsFilePath & "_" & w & ".indd")

        close active document

        delay 1

    end repeat

    close dsDoc saving no

end tell

m.

Message was edited by: myDwayneSmith

Sorry,  just posted this before seeing the 5.5 thing — should still work if you update the version number in the first line.

You might need to change "set dsFilePath to (full name of dsDoc) as text" to "set dsFilePath to (full name of dsDoc) as string"

Green4ever
Inspiring
January 6, 2012

Yes. Our fellow scripter wrote a script for this, please check this site more details....

http://www.loicaigon.com/en/auto.php?goTo=2

See to the Extract Pages script (5 th script I think)

Thanks,

Green4ever

blasto333Author
Participant
January 6, 2012

Is there one for cs 5.5?