Copy link to clipboard
Copied
I have a scriptUI palette I'm working on. Making progress but now my button won't run the function. Is this correct?
myPanel.grp.groupOne.groupTwo.createSnipesButton.onClick = function() {
alert("trying to run the function");
createSnipes();
}
then my function should run when that button is clicked. I have this dialog stuff happening in a function and the createSnipes() function is outside this. Does something need to happen differently? Maybe it can't reach outside itself?
I collapsed all the functions so you can see the top level structure.
Copy link to clipboard
Copied
Try declaring res.
Put "var" before res.
Copy link to clipboard
Copied
Also, #target not required, i generally don't use as i run the script from File> script > run script.
Copy link to clipboard
Copied
I tried that but it didn't work. Is it because this palette is nested in a function twice?
function myScript(thisObj){
function myScript_buildUI(thisObj){
Copy link to clipboard
Copied
I think I fixed it. I moved all those functions I had under the myScript() function.
Copy link to clipboard
Copied
I cannot get my functions to call now. If I nest them in the function I'm in it works, but if I leave them all at a higher level they won't run. I can't keep nesting functions inside of other functions because many are reused throughout the script. I tried to write one of them to a separate file and use #include but it does not seem to work either. What am I doing wrong?