Hello! I am new to the forums and rather new to javascript as it relates to indesign so I apologize if this is rudimentary.
I am building a script that automates new document creation for our company and have run into a problem with placing library assets.
I want to add a library asset to a specific master page by name, but I cannot find a way to do this.
I can get assets to place into my document with this:
var t = app.libraries.item(0);
var libTapeStrip= t.assets.itemByName('Tape Strip');
var myTapeStrip = libTapeStrip.placeAsset(myDocument);
However, the asset is being placed on a master spread that I had previously added to the document. It seems to be the active or front most spread because when the script is complete and I create a new window that spread is what is displayed with the asset on it.
I would like to place the asset on another master spread, but placeAsset() only accepts documents and text boxes. I have also looked on a way to bring the master spread I want to the front, but cannot find this either.
If anyone can lead me in the right direction I would appreciate it!!
Thanks,
Ben