I have a script attached to a button in perspective that I would like to trigger when the view is opened. I know I can use the onStartup event on the view but I would rather not have two copies of the script floating around. I also don’t use this script repeatedly so it isn’t a good candidate for a global script resource. Is there a way to trigger the onClick event in this button using scripting within the onStartup event on the view?
Don’t try to fire a click event programatically.
Move the logic into a message handler with the appropriate scope.
View onStartup
and the button’s onClick
can both just fire the message hook.