Listbox Woes
Posted: March 15th, 2011, 5:33 pm
Hi, I am having a few issues with my listbox UI.
It is looking pretty good but there are a few issues:
a) no close button ( I have closeButton: true in my script)
b) I can't copy the data to the clipboard (I can select the items but they don't make it into the clipboard)
c) I can't get the headings in the list box ( I tried this).
var list = dlg.add ("ListBox", [0, 0, 400, box_height], "a", {numberOfColumns: 5, showHeaders: true, columnTitles: ["Layer", "In", "Out"], multiselect: true});
And I get an "uncaught exception add" error.
Below is my script, any help would be great.
Cheers.
Phil
var myComp = app.project.activeItem;
var myLayers = myComp.selectedLayers;
var dlg = new Window("dialog", "Analyze Edit", undefined, {closeButton: true});
var box_height = myLayers.length *17;
var list = dlg.add ("ListBox", [0, 0, 400, box_height], "a", {numberOfColumns: 5, multiselect: true});
for (var i = 0; i <= myLayers.length -1 ; i++){
var layerName = myLayers.name;
var layer_in = myLayers.inPoint / myComp.frameDuration;
var layer_out = myLayers.outPoint / myComp.frameDuration;
var layer_time = myLayers.startTime / myComp.frameDuration ;
var source_name = layerName;
var source_in = Math.ceil(layer_in - layer_time);
var source_out = Math.ceil(layer_out - layer_time);
var item1 = list.add ("item");
item1.subItems[0].text =i+1;
item1.subItems[1].text = source_name;
item1.subItems[2].text = source_in;
item1.subItems[3].text = source_out;
} //end loop
dlg.show();
It is looking pretty good but there are a few issues:
a) no close button ( I have closeButton: true in my script)
b) I can't copy the data to the clipboard (I can select the items but they don't make it into the clipboard)
c) I can't get the headings in the list box ( I tried this).
var list = dlg.add ("ListBox", [0, 0, 400, box_height], "a", {numberOfColumns: 5, showHeaders: true, columnTitles: ["Layer", "In", "Out"], multiselect: true});
And I get an "uncaught exception add" error.
Below is my script, any help would be great.
Cheers.
Phil
var myComp = app.project.activeItem;
var myLayers = myComp.selectedLayers;
var dlg = new Window("dialog", "Analyze Edit", undefined, {closeButton: true});
var box_height = myLayers.length *17;
var list = dlg.add ("ListBox", [0, 0, 400, box_height], "a", {numberOfColumns: 5, multiselect: true});
for (var i = 0; i <= myLayers.length -1 ; i++){
var layerName = myLayers.name;
var layer_in = myLayers.inPoint / myComp.frameDuration;
var layer_out = myLayers.outPoint / myComp.frameDuration;
var layer_time = myLayers.startTime / myComp.frameDuration ;
var source_name = layerName;
var source_in = Math.ceil(layer_in - layer_time);
var source_out = Math.ceil(layer_out - layer_time);
var item1 = list.add ("item");
item1.subItems[0].text =i+1;
item1.subItems[1].text = source_name;
item1.subItems[2].text = source_in;
item1.subItems[3].text = source_out;
} //end loop
dlg.show();