Copy link to clipboard
Copied
I have a lot of checkboxes, I want to add on focus script to all the checkboxes, is there a way to automate this?
Copy link to clipboard
Copied
You can use this in a button or run from console:
for(var i=0; i<this.numFields; i++){
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if(f==null) continue;
if(f.type=="checkbox") f.setAction("OnFocus", "Put your script here");}
In your script, use single quotes or escape quotes with backslash.
Copy link to clipboard
Copied
You can use this in a button or run from console:
for(var i=0; i<this.numFields; i++){
var fname = this.getNthFieldName(i);
var f = this.getField(fname);
if(f==null) continue;
if(f.type=="checkbox") f.setAction("OnFocus", "Put your script here");}
In your script, use single quotes or escape quotes with backslash.
Copy link to clipboard
Copied
Nice work!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now