-
1. Re: moving a paragraph inside anchored text box...
Haakenlid Dec 18, 2010 5:30 AM (in response to Green4ever)Could it be that myText.insertionPoints[1] does not exist? That would be the case if myText contains no characters.
-
2. Re: moving a paragraph inside anchored text box...
Harbs. Dec 18, 2010 2:35 PM (in response to Green4ever)The error message does not match the code you posted.
It's always advisable to use references to text in a Story rather than a TextFrame, because the latter can be overset and not have any valid insertionPoints...
Harbs
-
3. Re: moving a paragraph inside anchored text box...
Green4ever Dec 21, 2010 11:00 PM (in response to Harbs.)Hi,
I am giving my full codes here could you pls check and give some suggesstions..
function myStyleDialog(){ var myLabelWidth = 120; var myParaStyleNames = myGetParagraphStyleNames(); var myObjStyleNames = myGetObjectStyleNames(); var myDialog = app.dialogs.add({name:"Choose Styles to Place Anchor"}); with(myDialog.dialogColumns.add()){ with(borderPanels.add()){ with(dialogColumns.add()){ with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"Paragraph Styles:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ myParaStyleDropdown = dropdowns.add({stringList:myParaStyleNames, selectedIndex:0}); } } with(dialogRows.add()){ with(dialogColumns.add()){ staticTexts.add({staticLabel:"Object Styles:", minWidth:myLabelWidth}); } with(dialogColumns.add()){ myObjectStyleDropdown = dropdowns.add({stringList:myObjStyleNames, selectedIndex:0}); } } } } myReturn = myDialog.show(); if(myReturn == true){ myParagraphStyle = myParaStyleNames[myParaStyleDropdown.selectedIndex]; myObjectStyle = myObjStyleNames[myObjectStyleDropdown.selectedIndex]; myDialog.destroy(); } else { myDialog.destroy(); } } } function myGetParagraphStyleNames(){ var myStyleNames = app.documents.item(0).paragraphStyles.everyItem().name; return myStyleNames; } function myGetObjectStyleNames(){ var myObjStyleNames = app.documents.item(0).objectStyles.everyItem().name; return myObjStyleNames; } var myDoc = app.documents[0]; var myLib = app.libraries[0]; app.findTextPreferences = NothingEnum.nothing; app.changeTextPreferences = NothingEnum.nothing; app.findTextPreferences = null; app.findTextPreferences.appliedParagraphStyle=myParagraphStyle; myFind = myDoc.findText(true); var myCount=0; for (i=0; i<myFind.length; i++) { myText = myLib.assets.item ("ANNO").placeAsset (myFind[i].insertionPoints[-1])[0]; myFind[i].move(LocationOptions.after, myText.insertionPoints[0]); myText.appliedObjectStyle = myDoc.objectStyles.item (myObjectStyle); myText.fit(FitOptions.frameToContent); myCount++; } alert(myCount+" ANNOs are Placed Successfully...");One more information: This script is done with reference to the CS3 reference, But i'm working in CS4. May this will be a problem because of some object model has been upgraded in CS4?
Hi can anyone Help..... Message was edited by: Green4ever
-
4. Re: moving a paragraph inside anchored text box...
Green4ever Dec 23, 2010 2:34 AM (in response to Green4ever)Hi All please check this and give any suggestions......
-
5. Re: moving a paragraph inside anchored text box...
[Jongware]-9BC6tI Dec 23, 2010 2:50 AM (in response to Green4ever)I can't find that line #84 in your code; neither by counting (your "full codes" has only 71 lines), nor by looking for the line that triggered the error ("myFind[i].move(LocationOptions.after, myText.insertionPoints[1]);").
You are making it hard to help you.





