-
refresh project.selection in script extendscript
Hi! I wrote a script that search for text layers in selected comp items and enable or disable them. Works fine but when I make another selection while the script interface is running it doesnt work… I want to launch the script and then do the selection… I dont want to make the selection before launch it. Any ideas?
this is what I have:
var proj = app.project;
{
function myScript(thisObj) {
function myScript_buildUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Textless_MOOCO_v01", [0, 0, 300, 300]);res = "group{orientation:'column', alignment:['fill', 'fill'], alignChildren:['fill', 'fill'],\
panelOne: Panel{orientation:'row', alignChildren:['left', 'fill'],\
onBtn: RadioButton{text:'on'},\
offBtn: RadioButton{text:'off'},\
},\
}"// Adds resource string to panel
myPanel.grp = myPanel.add(res);// Assign function to UI elements
myPanel.grp.panelOne.onBtn.onClick = function(){
if(proj.selection > 0){
var textAry = getAllTextLayers (proj.selection);
for(a=0;a 0){
var textAry = getAllTextLayers (proj.selection);
for(a=0;a