In scripting, i would like to know how to insert an asset from a library directly in a page (Not simply on a document)
The only way i found is to use "Asset.placeAsset(document)" , however this doesn't work if i pass in a page instead.
What would be an appropriate workaround?
Asset.placeAsset() takes two kinds of arguments:
If you pass a Text-object the asset will be placed inline.
If you use document the asset will be placed on the active page.
Activate the proper page like so:
app.layoutWindows.item(app.activeDocument.name).activePage = app.activeDocument.pages[x];
Floating my own boat here, but check out http://extendables.org/docs/patches/application-specific/indesign.html#placing-library-ass ets Using that method, you can choose a precise location on which to place an asset (page, x, y, even a particular layer). If you don't care to use the entire framework to do what you need to do, you can see the code for just this one method near the bottom of https://github.com/stdbrouw/Extendables/blob/master/patches/dom.indesign.jsx
Hope that helps.