• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Place assets only on First page

Explorer ,
Apr 16, 2013 Apr 16, 2013

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..

TOPICS
Scripting

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Apr 16, 2013 Apr 16, 2013

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]);

Votes

Translate

Translate
Enthusiast ,
Apr 16, 2013 Apr 16, 2013

Copy link to clipboard

Copied

onDocument

Text

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 16, 2013 Apr 16, 2013

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....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 16, 2013 Apr 16, 2013

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-

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 16, 2013 Apr 16, 2013

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]);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 17, 2013 Apr 17, 2013

Copy link to clipboard

Copied

LATEST

thank you -hans-,

you have simplified my complex script.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines