You do not use triggers on buttons. You use triggers on layouts or objects. Buttons are meant to run a script on-click, not on-trigger.
You want to go into layout mode, go to the Layouts menu, select "layout setup", then there is a triggers tab there that has the OnGestureTap trigger action that you can tie a script to.
From there, the script is fairly straightforward:
Set Variable [ $info ; Get(TriggerGestureInfo) ]
Set Variable [ $tapcount ; GetValue( $info ; 2 ) ]
Set Variable [ $fingers ; GetValue( $info ; 3 ) ]
Set Variable [ $left ; GetValue( $info ; 4 ) ]
Set Variable [ $right ; GetValue( $info ; 5 ) ]
---Do more actions based on the variables set above. EG $fingers = 1 / 2 / 3 for different tap actions, or detecting tapping "zones" on the layout based on the coordinates.
Got it thanks Mike. I was getting confused because it would still offer triggers as an option when right clicking the button. The button I was trying to set the script trigger to was a "pop-over" and I was trying to interrupt that process and have a custom dialog box appear first before the pop-over displayed. But I was kind of able to get what I wanted with OnObjectEnter.
Cool. There are many types of triggers:
Object triggers (where you were looking) like OnObjectEnter
Layout triggers (where you need to be) like OnLayoutEnter, OnRecordLoad, OnGestureTap
Window/file triggers like OnWindowOpen and OnLastWindowClose
They are all quite useful, and it’s important to understand how they work and in what context.
Often we use a script to open a popover--either triggered by tripping a script trigger or performed by clicking/tapping a button. The script can use Go To Object to open the popover. This then gives you the option to open your custom dialog before opening the popover and tripping the script trigger--which might be a bit cleaner than opening the popover first, then displaying the dialog only to have to close the popover if the user's response to the dialog makes that necessary.
You can always use Hide Object When to make the actual popover button invisible at all times while still using the script to open the popover itself. (And the object name has to be set on the popover panel, not the button.)
Thank you, that does look much cleaner. Using the Go To Object did allow the dialog to display prior to the popover!