Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Place InDesign File into another Indesign File

New Here ,
Jun 20, 2017 Jun 20, 2017

Hi All,

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 in applescript so I'm unable to specify what page of the document I want to place or the bounding box to use. This looks to be a bit of a dead end in Applescript so I wander if anybody could offer a solution in Extend JavaScript? Below is the applescript code that will allow me to place and InDesign file but does not allow me to specify the page I want to place or bounding box.

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

Thanks

TOPICS
Scripting
6.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 20, 2017 Jun 20, 2017

… Are you saying that I need to place the InDesign file first and then reference it as an Imported page to be able to use the PageCrop and PageNumber or rather than using the Place command I should be looking at Importing it?

Hi Nik,

no.

Before placing you are doing all the necessary preferences, then you'll placing.

Not tested and some pseudo code with the file object:

var oldPrefs = app.importedPageAttributes.properties;

app.importedPageAttributes.properties =

{

importedPageCrop : ImportedPageCropOpti

...
Translate
Community Expert ,
Jun 20, 2017 Jun 20, 2017

Hi,

cannot help with AppleScript code, but with ExtendScript:

1. The preferences for PDF placement are on the application: app.pdfPlacePreferences

There you set pageNumber, pdfCrop and transparentBackground.

2. A page object has a place() method where you define the file—your PDF file—and a placePoint.

You also could draw a rectangle on a page first and use place() on that rectangle, then you need no placePoint.

This should be possible with AppleScript as well.

Regards,
Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2017 Jun 20, 2017

Hi Uwe,

thanks for your response but I know how to place a specific page of a pdf into InDesign but I want to place the specific page of a InDesign file into another InDesign file. The reason for wanting to do this is for resizing purpose i.e. lets say the InDesign document that I want to place has 3 pages and is 297 x 420mm and the file that I want to place it into is 210 x 297mm. I was hoping to not have to export a PDF file just to have to reimport into a different size document.

Thanks,

Ni

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 20, 2017 Jun 20, 2017

Ni,

sorry. Was it the heat today?
I was so fixated on pdfs…

See for app.importedPageAttrbutes where you can define:

importedPageCrop and pageNumber .

What you are placing is an importedPage object.

Question is, if it is a good idea in contrast to exporting PDF/X-4 and placing the PDFs…
Handling is slower. You will get into trouble maybe, if you store documents with placed InDesign pages in InDesign book files that you want to open in a different InDesign version.

Regards,
Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2017 Jun 20, 2017

Hi Uwe,

no problem, think the heat is affecting everyone today!!

Are you saying that I need to place the InDesign file first and then reference it as an Imported page to be able to use the PageCrop and PageNumber or rather than using the Place command I should be looking at Importing it?

Once I have placed/imported the InDesign file I will be exporting it as a pdf. I just want the ability to use 1 size of an InDesign file and export it as PDF that has different dimensions.

Thanks,

Nik

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 20, 2017 Jun 20, 2017

… Are you saying that I need to place the InDesign file first and then reference it as an Imported page to be able to use the PageCrop and PageNumber or rather than using the Place command I should be looking at Importing it?

Hi Nik,

no.

Before placing you are doing all the necessary preferences, then you'll placing.

Not tested and some pseudo code with the file object:

var oldPrefs = app.importedPageAttributes.properties;

app.importedPageAttributes.properties =

{

importedPageCrop : ImportedPageCropOptions.CROP_BLEED ,

pageNumber : 1

};

var inddFile  = File("/blablabaPath/myInDesignDoc.indd");

var whereToPlace = app.activeDocument;

var pageToPlace = whereToPlace.pages[0];

pageToPlace.place( inddFile );

app.importedPageAttributes.properties = oldPrefs;

Since you are placing InDesign documents you could open the doc you want to place, check for pages.length, closing the doc and know how many pages you have to place.

Regards,

Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 20, 2017 Jun 20, 2017
LATEST

Hi Uwe,

Perfect!!!

Here's an applescript version of your code:

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

Many Thanks,

Nik

Nik

M

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines