Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Place library asset

$
0
0

Hi,

 

I am trying to develop a script to all list of Box elements in each library asset and it has been place each asset onto a page where myFind.text is cited.

 

This is my Script

 

var myDoc = app.activeDocument;

app.findTextPreferences = NothingEnum.nothing;

app.changeTextPreferences = NothingEnum.nothing;

app.findChangeTextOptions.caseSensitive = false;

app.findChangeTextOptions.includeFootnotes = false;

app.findChangeTextOptions.includeHiddenLayers = false;

app.findChangeTextOptions.includeLockedLayersForFind = false;

app.findChangeTextOptions.includeLockedStoriesForFind = false;

app.findChangeTextOptions.includeMasterPages = false;

app.findChangeTextOptions.wholeWord = false;

app.findTextPreferences.appliedParagraphStyle = "Box text";

myFind = myDoc.findText();

for(i=0; i<myFind.length; i++)

{

    myLib = app.libraries.item(0);

    myAnchorFrame = myLib.assets.item("Box").placeAsset(myFind[i].insertionPoints[0])[0];

    myFind[i].move(LocationOptions.after, myAnchorFrame.textFrames[0].insertionPoints[0]);

    myAnchorFrame.textFrames[0].parentStory.characters.item(-1).remove();

    myAnchorFrame.appliedObjectStyle = myDoc.objectStyles.item("Box");

    myAnchorFrame.fit(FitOptions.FRAME_TO_CONTENT);

   

    }

 

 

Hurix


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>