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
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.
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,
I am sorry I just get started with applescript, I know I make a lot of stupid errors (shame shame shame), but I really want to learn it.. so..
I tried this aswell:
tell application "Adobe InDesign CS5.5"
tell active book
set myDesktopFolder to path to desktop as string
set myFile to myDesktopFolder & "InteractivePDF.pdf" as string
set properties of interactive PDF export preferences to {export layers:true, generate thumbnails:true, pdf magnification:fit page, pdf page layout:single page}
export format interactive PDF to myFile
end tell
end tell
When I delete the sentence of properties, the export works fine. So at this moment only the sentence of the proporties has to be changed...
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,
I am sorry, but here I am again...
at the end of my script I want to create a book with the documents of the workingfolder.
this is wat I have (fileAlias and targetFolder are identified earlier in the script)
tell application "Adobe InDesign CS5.5"
set fileAlias to targetFolder as alias
set theBook to active book
make book content at theBook with properties {full name:fileAlias}
end tell
I get an error on make book content at... I think he wants to put the "folder" in the book, instead of the document in the folder.
thanks
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
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…
North America
Europe, Middle East and Africa
Asia Pacific