Copy link to clipboard
Copied
Hi Forum,
I m wondering, if can i place my Library assets.item(0) only on first page.
Because the below script places the Library assets, when i click a particular page...
Instead, when i run the script, the assets should be placed only on the first page..
Is it possible... I tried this way.. but doesnt works...
pg = app.activeDocument.pages.item(0);
//myrect = pg.rectangles.add(); (i tested with adding rectangles on the first page, it works)
var Lib = app.libraries[0].assets[0].placeAsset[pg][0];
thanks for the help forum...
Shil..
no need to select as you've already stored the obj in myObj
var currDoc = app.activeDocument;
var myObj = app.libraries[0].assets[0].placeAsset(currDoc)[0];
myObj.move(currDoc.pages[0]);
Copy link to clipboard
Copied
onDocument
Those are the possibilties.
So only a trick would work:
Create a empty textframe on destpage and place the asset on its insertionpoints[0].
Then set anchored objectsettings to customized (x,y to textframe top/ left zero).
detach the anchored object. Delete the textframe.
otherwise conventionell:
move the object after placing on document to any page.
Copy link to clipboard
Copied
hi -hans- thanks very much for your quick response.....
will moving the object placed to any page is possible. because i have a little bit confusing on selecting the placed object (if is the grouped text) alongwith the other text boxes on the same page.
how can i refer the placed object in script.
sorry for the confused state of question....
thanks for the reply.
shil....
Copy link to clipboard
Copied
hi -hans-
thanks for you brilliant idea...
now, i have tried like this...
pg = app.activeDocument.pages.item(0);
var myObj = app.libraries[0].assets[0].placeAsset(app.documents[0])[0];
app.select(myObj);
app.selection[0].move (app.activeDocument.pages[0]);
( it would be appreciate, if i get idea for delesecting the previous selected items and then select the corrently placed one).
thanks - hans-
Copy link to clipboard
Copied
no need to select as you've already stored the obj in myObj
var currDoc = app.activeDocument;
var myObj = app.libraries[0].assets[0].placeAsset(currDoc)[0];
myObj.move(currDoc.pages[0]);
Copy link to clipboard
Copied
thank you -hans-,
you have simplified my complex script.