Indesign Script UI copy text in list item
hi everyone,
i've written script ui code create termbase.
i want able click item in list in column , copy text edittext field.
i'm not sure if need create button or possible right click mouse copy text?
here code:
var w = new window ('dialog {text:"blatchford termbase",alignchildren:"fill"}');
w.spacing=0;
var headers = w.add('group');
headers.spacing=0;
headers.margins=[0,5,0,0];
var dimh = [0,0,200,20];
headers.add('statictext', dimh, '\u00a0english');
headers.add('statictext', dimh, '\u00a0french');
headers.add('statictext', dimh, '\u00a0german');
headers.add('statictext', dimh, '\u00a0italien');
headers.add('statictext', dimh, '\u00a0spanish');
headers.add('statictext', dimh, '\u00a0norwegian');
headers.add('statictext', dimh, '\u00a0russian');
headers.add('statictext', dimh, '\u00a0turkish');
headers.graphics.backgroundcolor=w.graphics.newbrush(w.graphics.brushtype.solid_color, [0.7,0.7,0.7],1);
for (var = 0; i<headers.children.length; i++)
headers.children[i].graphics.font=scriptui.newfont ('myriad pro', 'bold' , 16)
var columns = w.add('group{multiselect:true}');
columns.spacing=0;
var dimc = [0,0,200,600];
var col1 = columns.add('listbox', dimc, ["dorsiflexion", "plantarflexion","trans-tibial","trans-femoral"]);
var col2 = columns.add('listbox', dimc, ["dorsiflexion", "plantarflexion","trans-tibial","trans-femoral"]);
var col3 = columns.add('listbox', dimc, ["dorsiflexion", "plantarflexion","trans-tibial","trans-femoral"]);
var col4 = columns.add('listbox', dimc, ["dorsiflexion", "plantarflexion","trans-tibial","trans-femoral"]);
var col5 = columns.add('listbox', dimc, ["dorsiflexion", "plantarflexion","trans-tibial","trans-femoral"]);
var col6 = columns.add('listbox', dimc, ["dorsiflexion", "plantarflexion","trans-tibial","trans-femoral"]);
var col7 = columns.add('listbox', dimc, ["dorsiflexion", "plantarflexion","trans-tibial","trans-femoral"]);
var col8 = columns.add('listbox', dimc, ["dorsiflexion", "plantarflexion","trans-tibial","trans-femoral"]);
var user_input = w.add('group')
var entry = user_input.add('edittext',dimh, '');
entry.characters=30;
entry.alignment='left';
entry.active=true;
col1.selection=0;
var convert = user_input.add('button', undefined, 'convert lower case');
convert.onclick=function() {entry.text=entry.text.tolowercase();}
user_input.orientation='row';
user_input.alignment='left';
w.show();
any or comments appreciated
try this
col1.onchange = col2.onchange = col3.onchange = col4.onchange = col5.onchange = col6.onchange = col7.onchange = col8.onchange = function() { entry.text = this.selection? this.selection.text : ""; }
loic
More discussions in InDesign Scripting
adobe
Comments
Post a Comment