Using buttonImportIcon from within button field
I have a piece of script that was run by a mouse up event within a button field that used to work on a previous version of Acrobat Professional on a Mac (I may have had to change a setting or something to get it to work but I can't for the life of me remember what). I have upgraded to Catlalina and due to non-64 bit software being allowed I am now using DC but I am now getting a security error. The script and error are below, if anyone could help resolve that would be appreciated.
On Mouse Up run javascript
a = this.getField("HiddenText").valueAsString; b = this.getField("RelevantIcon").valueAsString; console.println(a+b); event.target.buttonImportIcon(a+b);
Console message:
/Macintosh HD/Users/xxxxx/Desktop/001.pdf NotAllowedError: Security settings prevent access to this property or method. Field.buttonImportIcon:4:AcroForm:Button1:Annot1:MouseUp:Action1
