I’m trying to place an InDesign file into another Indesign document for resizing purposes. The problem I’m having is specifying the place options. When you place a PDF you can specify PDF place preferences but there doesn’t seem to be any INDD place preferences so I’m unable to specify what page of the document I want to place or the bounding box to use. I would prefer not to export to PDF and then place that just so I can use the PDF place preferences. Any help is appreciated.
set inddFile to choose file of type "IDdC"
tell application "Adobe InDesign CC 2017"
-->I need to be able to set the below option for an INDD file
(*tell PDF place preferences
set page number to 2
set PDF crop to crop trim
end tell*)
set mydoc to active document
set pageFrame to item 1 of (every page item of mydoc whose label is "pageFrame")
tell pageFrame
place inddFile
fit given proportionally
fit given center content
end tell
end tell
Hi. The dictionary alleges that you can place with properties, however, only some properties”such as rotation angle”seem to work in my version; I can adjust the placed document’s page setting without returning an error, but the change is never realized. This appears to be a bug and likely may have persisted through your version, as programatically placing a document within another seems to be a far more niche use than is placing an image.
-- This is known to work in CS6. Adjust as necessary.
--kerflooey
set i to 1
repeat pageCount times
tell application "Adobe InDesign CS6"
activate
set pdfMapFP to (pdfMapFP as string)
set page number of PDF place preferences to i
get page number of PDF place preferences
set myDoc to active document
tell myDoc
--return properties of PDF place preferences
set lastPageObjectStyle to a reference to (every object style whose name is "LastPage") -- 101105a
--return lastPageObjectStyle
try
tell page i
place file pdfMapFP on every rectangle whose label is "pdfBox"
tell (every rectangle whose label is "pdfBox")
fit given proportionally
fit given center content
set the applied object style to lastPageObjectStyle -- 101105a
end tell
end tell
on error
-- no more map pages
exit repeat
end try
set i to i + 1
end tell
end tell
end repeat
kerflooey, are you saying that your script will work with placing and indd into another indd and that you can specify the page number of the input indd that you want to be placed? To me your script just looks like it works if the input file is a pdf?
Marc Anthony, I have posted my question on Adobes scripting forum incase more options are available using javascript. If it’s possible to do it using java then I’ll try to post an applescript wrapper for it.
set inddFile to choose file of type "IDdC"
tell application "Adobe InDesign CC 2017"
set oldPrefs to properties of imported page attributes
tell imported page attributes
set imported page crop to crop content
set page number to 2
end tell
set mydoc to active document
set pageFrame to item 1 of (every page item of mydoc whose label is "pageFrame")
tell pageFrame
place inddFile
fit given proportionally
fit given center content
end tell
set properties of imported page attributes to oldPrefs
end tell