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

AppleScripted Image Duplication: TIFFs Invisible but in Links Panel. Any Solutions?

New Here ,
Aug 28, 2023 Aug 28, 2023

Copy link to clipboard

Copied

I've encountered a rather puzzling scripting challenge with Adobe InDesign CC 2023. I hope someone might have come across a similar issue and could offer insights or solutions.

 

Background:
I'm using AppleScript to automate a workflow in InDesign. The primary goal is to copy a grouped object (2 inches x 4 inches which contains two TIFF images) from one document, and then paste it into a specific InDesign template. After this, I intend to save and export the new document as a PDF.

 

Issue:
Everything runs smoothly with the script, except for one major problem: the TIFF images, after being duplicated into the new document, are not visible on the page. Oddly enough, they are still present in the Links panel, and no warnings or issues are indicated there. I've checked typical suspects like layering, object styles, and visibility settings, but everything seems in order. Additionally:

  • The TIFFs are neither on a hidden layer nor obscured by other elements.
  • No object styles are causing the invisibility.
  • The Links panel doesn't show any warnings for these images.
  • Overprint Preview or Display Performance settings are not the culprits.

What I've Tried:

  1. Checked layers and object styles.
  2. Verified visibility in Overprint Preview and Display Performance.
  3. Used both copying-pasting and direct placing methods in the script.
  4. Ensured images aren't embedded, and tried updating links after duplication.
  5. Adjusted frame fitting.
  6. Tried manual relinking in the new document.

None of these resolved the issue.

I worked closely with an expert to troubleshoot this, but we're a bit stumped. It seems like a peculiar behavior specific to AppleScript's interaction with InDesign, or perhaps something about my particular InDesign setup or the TIFF images themselves.

Request:
Has anyone encountered a similar issue with AppleScript and InDesign, particularly regarding image visibility after scripted duplication? I'd be grateful for any insights, suggestions, or alternative approaches.

Thank you in advance for your help!

TOPICS
Scripting

Views

115

Translate

Translate

Report

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 ,
Aug 28, 2023 Aug 28, 2023

Copy link to clipboard

Copied

Hi @jeffpim , rather than getting and setting the groups’s geometric bounds, try using the move method. For example this would move a selected group (duplicatedItem in your code) and its page items to 0,0

 

 

tell application id "com.adobe.indesign"
	tell active document
		set ruler origin of view preferences to page origin
		set zero point to {0.0, 0.0}
		set s to item 1 of selection
		move s to {0, 0}
	end tell
end tell

 

 

Before and after:

 

Screen Shot 25.pngScreen Shot 26.png

Votes

Translate

Translate

Report

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 ,
Aug 28, 2023 Aug 28, 2023

Copy link to clipboard

Copied

LATEST

Rob,

Your solution worked great! Thanks so much!
Jeff

 

The updated code is below:

 

tell application "Adobe InDesign CC 2023"
-- Assuming you have a grouped object selected in your current document
set myDoc to active document
set selectedItem to selection

if (count of selectedItem) is equal to 0 then
display dialog "Please select a grouped item in the document." buttons {"OK"} default button "OK"
return
end if

-- Open specific InDesign template file
set templatePath to "Macintosh HD:Users:Username:import.indt"
set templateDoc to open templatePath

-- Duplicate the selected item to the new document
set duplicatedItem to duplicate selectedItem to beginning of page 1 of templateDoc

-- Move the duplicated item to {0, 0} (Top-left corner)
tell templateDoc
set ruler origin of view preferences to page origin
set zero point to {0.0, 0.0}
set s to item 1 of duplicatedItem
move s to {0, 0}
end tell

-- Save-as the document
set saveName to "Macintosh HD:Users:Username:import.indd"
save templateDoc to saveName

-- Export as PDF
set pdfPath to "Macintosh HD:Users:Username:import.pdf"
export templateDoc format PDF type to pdfPath without showing options

-- Close the template document without saving further changes

Votes

Translate

Translate

Report

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