How to get the Column number


hi all,

 

i'm sorry ask question found 2 different answers, tried them without result. before becoming mad prefer ask !

 

so given myselection = app.selection[0], how possible column in selection?

 

i tried app.selection[0].parenttextframes[0].characters.itembyrange(0, x)

     x being app.selection[0].index.

     i'm stuck if add ".textcolumns" error

 

i explored second way using app.selection[0].textcolumns.item(1).insertionpoints.item(1), again i'm stuck.

 

as beginner don't understand why there no simple built-in function call in order such basic result

 

any appreciated

 

thanks

 

ed

hi ed

 

before go mad

var myselection = app.selection[0]; var mycolumnindex = myselection.parenttextframes[0].characters.itembyrange (0, myselection.index).textcolumns.length - 1; var mycolumn = myselection.parenttextframes[0].textcolumns[mycolumnindex]; var mycolumnsfirstword = mycolumn.words[0].contents; alert('mycolumnindex: ' + mycolumnindex + '\nmycolumn: ' + mycolumn + '\nmycolumnsfirstword: ' + mycolumnsfirstword); 

hth

 

trevor



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?

Animate - problem with duplicating scripts after loop