Skip to main content
Participant
April 1, 2024
Question

PlaceGun does not have reference to idms textframe

  • April 1, 2024
  • 1 reply
  • 1765 views

Hi,

I'm trying to place a textframe from an idms file into an indesign document. The actual loadPlaceGun() operation seems to work fine as I'm able to paste the textframe on the page. However, I also want to have a reference to that textframe. I was trying to accomplish this by using 

placeGun.pageItems.everyItem().getElements(), but it doesn't return any elements. I find this odd because I'm using the same method when inserting images and it works fine, so I'm not sure what the issue is. Any ideas would be appreciated!

 

 

Thanks
This topic has been closed for replies.

1 reply

Robert at ID-Tasker
Legend
April 1, 2024

Workaround:

  1. Add an empty page at the end of the document.
  2. Place your IDMS file there.
  3. Get a reference to the 1st - and only - object on that page.

 

Phil 815
Inspiring
April 2, 2024

Hi Robert,

Thanks for the suggestion. Unfortunately that's not going to work for my needs; I can't have an empty page hanging around at the end of the document. At that point I might as well embed a script label in the IDMS that I load so I can look it up with that label after placing it on the page. I'm surprised this hasn't been fixed as it's a tool that was available in Extendscript so it's not a new feature.

Robert at ID-Tasker
Legend
April 2, 2024

@Robert at ID-Tasker without getting too into the weeds, the script we're writing is for production use by our stakeholders. So we don't want to require them to manually remove a page in their workflows (stakeholders will also be working with a dynamic number of pages at any given time, so it would be difficult to programmatically remove this without a risk of data loss).

 

Like I mentioned, I think we may be able to get something that works by adding a script label in the textframe of the idms that uniquely identifies it so we can find it on the page after rendering and continue to edit from there... it's just unfortunate that we have to do this sort of workaround  


quote

@Robert at ID-Tasker without getting too into the weeds, the script we're writing is for production use by our stakeholders. So we don't want to require them to manually remove a page in their workflows.

[...] 


By @Phil 815

 

???

 

Who said anything about removing manually?

The same way as you are adding page -

 

myDoc.pages.add()

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Pages.html#d1e205795__d1e205844

 

the same way you can remove it:

 

myDoc.pages[-1].remove()