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

script for select image into indesign .

Community Beginner ,
Feb 02, 2018 Feb 02, 2018

hi .

script for select image into indesign .

pleas help me.

3.9K
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 ,
Feb 02, 2018 Feb 02, 2018

This would loop thru the active document and select each graphic

var g=app.activeDocument.allGraphics;

for (var i = 0; i < g.length; i++){

    g.select();

    //Do something

};

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 Beginner ,
Feb 02, 2018 Feb 02, 2018

how script for select frame?


Like the following photo

899.JPG

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 ,
Feb 02, 2018 Feb 02, 2018

how script for select frame?

The frame is usually a graphic's parent, so this version of the loop gets the width and height of the container frames by using .parent

var g=app.activeDocument.allGraphics;

for (var i = 0; i < g.length; i++){

    //bounds returns as a list [y1, x1, y2, x2], so height is y2-y1

    //parent is the graphic's container frame

    var b = g.parent.geometricBounds

    var w = b[3]-b[1];

    var h = b[2]-b[0];

    $.writeln("\nWidth: " + w + "\nHeight: " + h)

};

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 ,
Feb 02, 2018 Feb 02, 2018

You'll get better responses over in the scripting forum

InDesign Scripting

You don't have to select the image to get its properties.

This gets each image's bounds and then calculates the width and height and writes the results into  the ExtendScript console.

var g=app.activeDocument.allGraphics;

for (var i = 0; i < g.length; i++){

    //bounds returns as a list [y1, x1, y2, x2], so height is y2-y1

    var b = g.geometricBounds

    var w = b[3]-b[1];

    var h = b[2]-b[0];

    $.writeln("Width: " + w + "\nHeight: " + h)

};

Here is the complete InDesign JavaScript API

https://www.indesignjs.de/extendscriptAPI/indesign10/

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 Beginner ,
Feb 02, 2018 Feb 02, 2018

i want get height and width frame.

Take a look at the top photo.

now, i want get height and width frame in indesign . Like the following photo96.JPG

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 ,
Feb 02, 2018 Feb 02, 2018

This would get the width and height of a selected object;

var sel=app.activeDocument.selection[0];

var b = sel.geometricBounds;

var w = b[3]-b[1];

var h = b[2]-b[0];

alert("\nWidth: " + w + "\nHeight: " + h);

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 Beginner ,
Feb 02, 2018 Feb 02, 2018

i want get height and width frame.

Take a look at the top photo

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 Beginner ,
Feb 02, 2018 Feb 02, 2018

My question is that:
how select this frame for get hieght and width?.
I want to choose a frame like choose a img in indesign .
how script for select this frame  In the picture below.

pleas help me. sorry
96.JPG

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 ,
Feb 02, 2018 Feb 02, 2018

Perhaps it may assist us if the opening poster can kindly explain - in full detail - what the script is required for and how many more steps are involved. It's possible a script that the opening poster is after may exist for free in the public domain, and if that is the case a link can be provided.

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
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 Beginner ,
Feb 03, 2018 Feb 03, 2018
LATEST

i want script to select all text frames and get hieght , width any one text frame.

The script does the following(photo).82.JPG

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