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

Is there a way to make a jsx script work even though images are invisible ('overset text')?

Explorer ,
Jan 22, 2016 Jan 22, 2016

Copy link to clipboard

Copied

We have made a script that runs after import of xml in InDesign, which addresses images in xml that are too big to handle (for example 4000px). It adds an object style to the images and makes the images fit the width of a text frame, so it easier to handle.


Never the less it is impossible to make the script work, when images that are hidden Is there a way to make the script work even though images are in 'overset text'?

J.

TOPICS
Scripting

Views

353

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
Advisor ,
Jan 23, 2016 Jan 23, 2016

Copy link to clipboard

Copied

Kind of hard to give you an answer without seeing some code and some more details. Why is it "impossible"?

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
Contributor ,
Jan 25, 2016 Jan 25, 2016

Copy link to clipboard

Copied

LATEST

Hi

this is a sample code to modify overset graphicframe by using huge temporary textframe;

// document has a textframe and its story has a overset graphicframe with large image

var doc      = app.documents[0];

var stry     = doc.stories[0];

var imgframe = stry.pageItems[0];

var insert_point = imgframe.parent;

var insert_point_idx = insert_point.index;

// create temporary textframe to rescue the graphicframe

var huge_textframe = doc.textFrames.add({geometricBounds:[0,0,4000,8000]});

// duplicate the insertpoint with the graphicframe to temporary textframe

var dup_insert_point = insert_point.duplicate(LocationOptions.AT_BEGINNING, huge_textframe.parentStory);

// resize the graphicframe

var dup_imgframe = dup_insert_point.pageItems[0];

dup_imgframe.geometricBounds = [0,0,300,400];

dup_imgframe.fit(FitOptions.CONTENT_TO_FRAME);

// restore the modified graphicframe to the end of original textframe story

var mod_insert_point = dup_insert_point.duplicate(LocationOptions.AT_END, insert_point.parent);

// move to original position

mod_insert_point.move(LocationOptions.BEFORE, insert_point.parent.characters[insert_point_idx])

// remove temporary textframe and overset graphicframe

stry.characters.itemByRange(insert_point_idx+1,insert_point_idx+1).remove();

huge_textframe.remove();

thank you

mg.

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