How can i close a custom dialog after "X" seconds in a script ?
FileMaker can't do that. If you are on Mac: Applescript can do.
Don’t use a custom dialog. Use either a card window, document window or popover in place of your custom dialog. Then you’ll have several scripted options for closing the window or popover after time interval has expired.
I'm not aware of a way to do this for Show Custom Dialog, but you could use a Pause with a set duration on a card window.
+ 1 -- what philmodjunk said. Card window, which can even be made to look like a native dialog box with a bit of cheating...
So can a popover and that option works in older versions than v16.
Also true.. little less easy to style, and it depends on the desired behaviour as the ability to click off and close the popover may be an undesired thing
I prefer the card window too, but sometimes am supporting an older version. It’s pretty easy to hide the button and make the panel border transparent to make it look like a dialog. The fact that you can close it by clicking/tapping the layout background can be a problem or a “feature” where it’s just an easy way to cancel the “dialog”.
Thanks for the suggestions.
If you ever want to do it with a proper dialog, it's easy with 24U SimpleDialog Plug-In:
SDialog_Set( "dialog-timeout" ; 10 )
SDialog_InputDialog( "Simple with buttons" ; "First¶Second" )
Retrieving data ...