I’ve updated it to include frames.
There might be an easier way to add frames and seconds, but I’ve bodged it this way and it works fine.
var win = new Window (“palette”,”Comp Duration”,undefined);
var title = win.add(‘statictext’,undefined,”Seconds”);
var myTextSec = win.add(‘edittext’,[100,120,150,140],0);
var title2 = win.add(‘statictext’,undefined,”frames”);
var myTextFrames = win.add(‘edittext’,[100,120,150,140],0);
var btn = win.add(‘button’,undefined,”Submit”);
btn.onClick = function(){
var myComp = app.project.activeItem;
var text1 = myTextSec.text;
var text2 = myTextFrames.text;
myComp.duration = text1;
myComp.duration += text2*myComp.frameDuration;// set duration
}
win.show();
All it’s doing is changing the comp based on seconds, then changing it a second time to add the frames separately. If someone can offer a way to change it in one line cool. Otherwise this will work fine for you.