Skip navigation
Currently Being Moderated

Applescript - export book to interactive pdf

Feb 18, 2012 10:40 AM

Hi guys,

 

i want to make a script to export a book to interactive pdf.

 

This is what I get, but i doesn't seem to work. What do I do wrong?

 

tell application "Adobe InDesign CS5.5"

                              tell active book

                                        tell mybook

  export format interactive PDF to myFile

                                                  set export layers of interactive PDF export preference to true

                                                  set generate thumbnails of interactive PDF export preference to true

                                                  set pdf magnification of interactive PDF export preference to fit page

                                                  set pdf page layout of interactive PDF export preference to single page

                                        end tell

                              end tell

 

 

 

thanks

 
Replies
  • Currently Being Moderated
    Feb 18, 2012 10:58 AM   in reply to Evilia_77

    Why "doesn't it seem to work"?

     

    (thinking) ... if you think it "doesn't work" because (a) you get a PDF, (b) it's interactive (whatever that means), but (c) none of the settings you specify are applied, then it's quite simple. The first line after "tell mybook" exports your PDF. When it's done, the rest set the preferences for a next export. This is equal to, well, something like first printing an entire document and when it's done say "Oh I only wanted pages 1 to 10. If I change that in the Print dialog now it might still work".

     

    Try with setting the preferences first and only then export.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 18, 2012 11:32 AM   in reply to Evilia_77

    The green items of your code are variables neither of which you declare/set in your sample… myFile, mybook… what file, what book… You also reference one book inside another I don't use books so Im unsure is this valid? It's like asking for document 1 of the active document in terms of objects and containers can this exist?

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 18, 2012 11:47 AM   in reply to Evilia_77

    Im just having a quick look at the documentation as its an app feature I've yet to utilize… Looks like you need a couple of additional parameters eg. book content and so on… All new to me I will go see if I can make a book…

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 18, 2012 12:24 PM   in reply to Muppet Mark

    By the looks of things its just an issue of being out of order… Jong correctly pointed out the prefs before the export but the do infact belong to the app and not a book so they should be moved like so…

     

    set iaPDF to (path to desktop as text) & "Testing.pdf"

    --

    tell application "Adobe InDesign CS5"

      activate

              tell interactive PDF export preferences

                        set export layers to true

                        set generate thumbnails to true

                        set pdf magnification to fit page

                        set pdf page layout to single page

              end tell

              tell active book

      export format interactive PDF to iaPDF

              end tell

    end tell

     

    First time book user and I got a PDF interactive? who knows…

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 18, 2012 12:41 PM   in reply to Evilia_77

    No problem… My mind is becoming some what fuzzy around the edges with AppleScript… Muppets inherit fuzzy from parent… can't help it…

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 18, 2012 1:48 PM   in reply to Evilia_77

    It looks like you should loop through adding content to a book… This worked for me it does NO checking of the selected folder for its file content type in my test case just ID docs…

     

    set idBook to (path to desktop as text) & "Testing.indb"

    --

    tell application "Finder"

              set idFiles to (files of (choose folder)) as alias list

    end tell

    --

    tell application "Adobe InDesign CS5"

      activate

              set mybook to make new book ¬

      with properties {full name:idBook}

              tell mybook

                        repeat with i from 1 to count of idFiles

      make new book content ¬

      with properties {full name:item i of idFiles}

                        end repeat

      save

              end tell

    end tell

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 20, 2012 10:39 AM   in reply to Evilia_77

    repeat with i from count of idFiles to 1 by -1

    --will reverse the loop…

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 20, 2012 11:33 AM   in reply to Evilia_77

    I don't do books only free stuff pdf manuals and such you should get yourself the Apple Guide… from:

     

    http://manuals.info.apple.com/en_US/AppleScriptLanguageGuide.pdf

     

    Shirley Hopkins books are always recommended…

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points