Skip to main content
Participant
April 1, 2024
Question

PlaceGun does not have reference to idms textframe

  • April 1, 2024
  • 1 reply
  • 1764 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

Thanks Robert!

Agreed that this would allow us to get the reference, but it's still not the workflow we're looking for. We want the user to be able to place the textframe in a spot they choose, not on a separate page. So I think we'd be losing the benefit of the placeGun even though we would have a reference to the textframe. Having said that I'll try some form of your suggestion today and get back. I'm also going to try the script label idea I mentioned. 


@Phil 815 

 

Right, PlaceGun.

 

It works in VB - but the moment user clicks somewhere on the page - you no longer have a working reference to the "loaded" object...

 

So you would have to "label" it:

Function LoadPlaceGun()
   Dim qqq As Variant
   
   Call myInDi.ActiveDocument.PlaceGuns.LoadPlaceGun("C:\temp\qqq.svg", False)
   Set qqq = myInDi.ActiveDocument.PlaceGuns.PageItems
   qqq.Item(1).Label = "QWE"
End Function

 

 

and then find it by this label - no need to label IDMS file.