Dialog.GetButtonPressed
-----------------------

Queries index of selected button.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Dialog](component_Dialog.md) | [7.2](newinversion72.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Dialog.GetButtonPressed" ) ### Parameters

none

### Result

Returns number or error.

### Description

Queries index of selected button.  
Value is negative If not applicable.  
Index is 0 for first button.  
### Examples

Run dialog with one Let statement:

 Let (   
\[  
 \_ = MBS ("[Dialog.Reset](DialogReset.md)") ;  
 \_ = MBS ("[Dialog.SetDefaultButton](DialogSetDefaultButton.md)" ; "Yes") ;  
 \_ = MBS ("[Dialog.SetOtherButton](DialogSetOtherButton.md)" ; "No") ;  
 \_ = MBS ("[Dialog.SetAlternateButton](DialogSetAlternateButton.md)" ; "Cancel") ;  
 \_ = MBS ("[Dialog.SetMessage](DialogSetMessage.md)" ; "Delete the old file?") ;  
 \_ = MBS ("[Dialog.SetWindowTitle](DialogSetWindowTitle.md)" ; "Backups done") ;  
 \_ = MBS ("[Dialog.Run](DialogRun.md)") ;  
 button = MBS ("Dialog.GetButtonPressed")  
\] ;  
 // 0 -&gt; Yes, 1 -&gt; No, 2 -&gt; Cancel  
 button  
)  
### See also

- [Dialog.GetButton](DialogGetButton.md)
- [Dialog.Reset](DialogReset.md)
- [Dialog.Run](DialogRun.md)
- [Dialog.RunSheet](DialogRunSheet.md)
- [Dialog.SetAlternateButton](DialogSetAlternateButton.md)
- [Dialog.SetButton](DialogSetButton.md)
- [Dialog.SetDefaultButton](DialogSetDefaultButton.md)
- [Dialog.SetMessage](DialogSetMessage.md)
- [Dialog.SetOtherButton](DialogSetOtherButton.md)
- [Dialog.SetWindowTitle](DialogSetWindowTitle.md)

### Release notes

- **Version 7.2**
    - Added [Dialog.GetButtonPressed](http://www.mbsplugins.eu/DialogGetButtonPressed.shtml) function.

### Blog Entries

- [Dialogs with fields for Windows](https://www.mbsplugins.de/archive/2026-02-25/Dialogs_with_fields_for_Window/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Advent calendar - Door 12 - Sending Mails](https://www.mbsplugins.de/archive/2024-12-12/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 17 - Dialog](https://www.mbsplugins.de/archive/2023-12-17/MBS_Plugin_Advent_calendar_17_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.2pr3](https://www.mbsplugins.de/archive/2017-04-19/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 6th April 2017 , last changed 21st February 2026

  
[Dialog.GetButton](DialogGetButton.md) - [Dialog.GetButtons](DialogGetButtons.md)

[HTML Version](DialogGetButtonPressed.shtml)