Aborting Script and Allowing Normal Behavior to Occur
If a field is configured so that clicking on it runs a script, is there a way from within the script to abort/cancel and allow the field's normal click behavior to occur?
Example: Suppose I have a container field which triggers a script when the field is clicked. Based on logic in the script, sometimes an Insert File dialog should be displayed. Other times, the script should stop running and the field should behave as though it hadn't triggered a script--that is, the normal Record Audio dialog or right-click pop-up menu s开发者_运维百科hould be displayed. How would I go about doing this?
Thank you,
BenYou could setup a script trigger OnObjectEnter as this allows the contextual menu. If you set a button on the field the contextual menu will not be displayed and there is no way to get it to appear thru scripting.
The script trigger for OnObjectEnter will also get called AFTER the user selects one of the import options (or if they don't select any option) but it also gets called if the user directly clicks on the field.
This script (screenshot below) should solve your problem. Let me know if it doesn't.
精彩评论