Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5955179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:04:37+00:00 2026-05-22T18:04:37+00:00

Current set-up: Adobe InDesign Server CS5 scripted through ExtendScript via PHP SOAP The problem:

  • 0

Current set-up:

Adobe InDesign Server CS5 scripted through ExtendScript via PHP SOAP

The problem:

I’m currently placing an image file into a rectangle using the following code:

 frame     =   doc.rectangles[0];
 imgList   =   frame.place(new File(img));

This works fine; the img file is placed into the rectangle as expected. However, this only refers to the first rectangle in the document: if I have two rectangles in the document, the image is placed into the last created rectangle.

What I’d ideally like to be able to refer to the rectangle by its XML tag – something like:

frame     =   doc.getRectangleByTag('Pic'); // <Pic> being the name of the XML tag
imgList   =   frame.place(new File(img));

Does anyone have any advice as to how this can be achieved? I realise this is rudimentary question, but am finding no joy after several hours of searching.

Many thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:04:38+00:00Added an answer on May 22, 2026 at 6:04 pm

    There isn’t a ‘getRectangleByTag‘ method that I know of. However, if you know the ‘id‘ or ‘name‘ property of the rectangle which you are looking for, you can loop through the rectangles in the document and finding it like this:

    var rectangles = doc.rectangles;
    var rectID; //the ID you're looking for
    var myRectangle;
    
    for(var i = 0; i < rectangles.length; i++){
       if(rectangles[i].id == rectID){
          myRectangle = rectangles[i];
       }
    }
    
    myRectangle.place(new File(img));
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is how our current php development solution is set up: Each developer work
My current set up is a single dedicated server with Java, hibernate app running
I tried using aegis -change_attributes to change the brief_description of my current change set
I use bzr for websites. I have all my current ones set up so
I am trying to set the current line number to a variable in Elisp
I know it is possible to set the current folder of the OpenFolderDialog to
Is it possible to set an UISlider as first responder and set its current
this is for a small project of mine, I'm trying to set the current
Our current MVC project is set up to have ViewModels that encapsulate the data
I have a pretty standard table set-up in a current application using the .NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.