A failure to communicate
Posted: Thu Nov 03, 2022 2:52 am
On a card make two buttons. Name one "XYZ". In the script of the other:
Works fine. A new button named "ABC" appears over the original "XYZ".
If you set a red dot breakpoint at the "set the name of..." line, you can see that the local variable "it" has assumed the long name of the newly created button. Stepping through the handler proceeds just fine. But if you set a red dot at the "paste" line, upon stepping through, the variable "it" remains empty, and the handler throws an error.
One has to paste before the new control "assumes" its long name and the variable "it" is populated? The control does not really "exist" when it is merely copied? Maybe this sort of makes sense...
Craig
Code: Select all
on mouseUp
copy button "XYZ"
paste --setting red dot here fails
set the name of it to "ABC" --setting red dot here works fine
end mouseUp
If you set a red dot breakpoint at the "set the name of..." line, you can see that the local variable "it" has assumed the long name of the newly created button. Stepping through the handler proceeds just fine. But if you set a red dot at the "paste" line, upon stepping through, the variable "it" remains empty, and the handler throws an error.
One has to paste before the new control "assumes" its long name and the variable "it" is populated? The control does not really "exist" when it is merely copied? Maybe this sort of makes sense...
Craig