Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Esc key on windows doesn't cancel custom dialog.

Featured Replies

Has anyone noticed that if you have a custom dialog in windows and you press the escape key, the dialog is dismissed but the script acts as though your pressed the default button just like if you hit return. If you actually click the cancel button, the Get(LastMessageChoice) works as expected. This doesn't happen on the Mac side as the escape key doesn't dismiss the dialog.

Is this a recent bug, because I could swear I've used the escape key before w/o a problem. My script is pasted below.


Show Custom Dialog [ Title: "Enter the Chembiz Sale ID"; Buttons: “OK”, “Cancel”; Input #1: sample::gt_tempSaleID, "Sale ID" ] 

If [ Get ( LastMessageChoice )=1 ] 

   Commit Records/Requests [ Skip data entry validation; No dialog ] 

   Enter Browse Mode 

   Replace Field Contents [ sample::s_saleId; Replace with calculation: sample::gt_tempSaleID ] [ No dialog ] 

   Replace Field Contents [ sample::s_billed; Replace with calculation: 1 ] [ No dialog ] 

   Replace Field Contents [ sample::s_billedDT; Replace with calculation: Get ( CurrentTimeStamp ) ] [ No dialog ] 

   Set Field [ sample::gt_tempSaleID; "" ] 

   Commit Records/Requests [ Skip data entry validation; No dialog ] 

Else 

   Set Field [ sample::gt_tempSaleID; "" ] 

   Commit Records/Requests [ Skip data entry validation; No dialog ] 

   Enter Browse Mode 

   Halt Script 

End If 

No bug, I believe this behaviour is consistent with earlier versions.

On the Mac, Cmd Period acts a lot like the Escape Key does on Windows, have you tried the Cmd Period on the Mac to see if it does the same thing?

  • Author

Nope, Cmd-period does not dismiss a custom dialog on the Mac. Only clicking the buttons or hitting return will do it, and return performs the default action as you would expect.

Whether or not the escape key behavior is a bug in the windows version or not, it is not how a dialog should act, and is not how they act in other applications, like FMP itself for instance...

  • 2 weeks later...
  • Author

Another little detail I noticed on this... If you press the Esc key and release quickly, the script treats it as though you hit the default button (even if there is no default button defined). But if you hold the Esc button down, it acts as though you aborted the script, and does not do the default action first. You can make the behavior more consistent, by turning off allow user abort. Then it acts like the default button no matter how long you hold the key.

Strangely, command-period on the mac does not abort the script when a dialog is present.

The esc behavior has been like this since the custom dialog was introduced. That way around is to make the "cancel" action your default button. That also means user's can't just hit enter to trigger the "go ahead" action.

When you hold down the esc key you're actually sending a multitude of esc commands to FM and FM will queue them up and act on them when it has time, meaning past the action of the custom dialog. If you have "allow user abort [off]" in your script then it should normally have no effect.

  • Author

The problem with making the cancel action the default button is that this doesn't work well with input fields... Oh well, I guess I'll just have to make my own dialogs with layouts and windows.

This (and other things) make the custom dialog function unusable. You better make your dialogs with a plugin.

Troi Dialog Plugin also has an issue with the escape or Cmd-period keys.

The best is the 24U SimpleDialog plugin.

The only 'Show custom dialog' script step in all my solutions is to display: "The dialog plug-in is missing" and close the file.

Edited by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.