Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

TouchBar.AddButton

Adds a simple button.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
TouchBar 6.5 Yes No No No No

MBS( "TouchBar.AddButton"; TouchBarRef; Identifier; Text; Image; CustomizationLabel; visibilityPriority; fileName; scriptName { ; Expression } )

Parameters

Parameter Description Example value
TouchBarRef The reference number for the touch bar. $TouchBar
Identifier The identifier for the new item. "com.yourdomain.send"
Text The text of the button.
Can be empty to show no text.
"Send"
Image The image of the button.
Pass container here with PNG for best result. JPEG may not work due to missing transparency.
Can be one of the following texts to pick a default image:
NSImageNameTouchBarAddDetailTemplate, NSImageNameTouchBarAddTemplate, NSImageNameTouchBarAlarmTemplate, NSImageNameTouchBarAudioInputMuteTemplate, NSImageNameTouchBarAudioInputTemplate, NSImageNameTouchBarAudioOutputMuteTemplate, NSImageNameTouchBarAudioOutputVolumeHighTemplate, NSImageNameTouchBarAudioOutputVolumeLowTemplate, NSImageNameTouchBarAudioOutputVolumeMediumTemplate, NSImageNameTouchBarAudioOutputVolumeOffTemplate, NSImageNameTouchBarBookmarksTemplate, NSImageNameTouchBarColorPickerFill, NSImageNameTouchBarColorPickerFont, NSImageNameTouchBarColorPickerStroke, NSImageNameTouchBarCommunicationAudioTemplate, NSImageNameTouchBarCommunicationVideoTemplate, NSImageNameTouchBarComposeTemplate, NSImageNameTouchBarDeleteTemplate, NSImageNameTouchBarDownloadTemplate, NSImageNameTouchBarEnterFullScreenTemplate, NSImageNameTouchBarExitFullScreenTemplate, NSImageNameTouchBarFastForwardTemplate, NSImageNameTouchBarFolderCopyToTemplate, NSImageNameTouchBarFolderMoveToTemplate, NSImageNameTouchBarFolderTemplate, NSImageNameTouchBarGetInfoTemplate, NSImageNameTouchBarGoBackTemplate, NSImageNameTouchBarGoDownTemplate, NSImageNameTouchBarGoForwardTemplate, NSImageNameTouchBarGoUpTemplate, NSImageNameTouchBarHistoryTemplate, NSImageNameTouchBarIconViewTemplate, NSImageNameTouchBarListViewTemplate, NSImageNameTouchBarMailTemplate, NSImageNameTouchBarNewFolderTemplate, NSImageNameTouchBarNewMessageTemplate, NSImageNameTouchBarOpenInBrowserTemplate, NSImageNameTouchBarPauseTemplate, NSImageNameTouchBarPlayheadTemplate, NSImageNameTouchBarPlayPauseTemplate, NSImageNameTouchBarPlayTemplate, NSImageNameTouchBarQuickLookTemplate, NSImageNameTouchBarRecordStartTemplate, NSImageNameTouchBarRecordStopTemplate, NSImageNameTouchBarRefreshTemplate, NSImageNameTouchBarRewindTemplate, NSImageNameTouchBarRotateLeftTemplate, NSImageNameTouchBarRotateRightTemplate, NSImageNameTouchBarSearchTemplate, NSImageNameTouchBarShareTemplate, NSImageNameTouchBarSidebarTemplate, NSImageNameTouchBarSkipAhead15SecondsTemplate, NSImageNameTouchBarSkipAhead30SecondsTemplate, NSImageNameTouchBarSkipAheadTemplate, NSImageNameTouchBarSkipBack15SecondsTemplate, NSImageNameTouchBarSkipBack30SecondsTemplate, NSImageNameTouchBarSkipBackTemplate, NSImageNameTouchBarSkipToEndTemplate, NSImageNameTouchBarSkipToStartTemplate, NSImageNameTouchBarSlideshowTemplate, NSImageNameTouchBarTagIconTemplate, NSImageNameTouchBarTextBoldTemplate, NSImageNameTouchBarTextBoxTemplate, NSImageNameTouchBarTextCenterAlignTemplate, NSImageNameTouchBarTextItalicTemplate, NSImageNameTouchBarTextJustifiedAlignTemplate, NSImageNameTouchBarTextLeftAlignTemplate, NSImageNameTouchBarTextListTemplate, NSImageNameTouchBarTextRightAlignTemplate, NSImageNameTouchBarTextStrikethroughTemplate, NSImageNameTouchBarTextUnderlineTemplate, NSImageNameTouchBarUserAddTemplate, NSImageNameTouchBarUserGroupTemplate, NSImageNameTouchBarUserTemplate, NSImageNameTouchBarVolumeDownTemplate or NSImageNameTouchBarVolumeUpTemplate.
"NSImageNameTouchBarMailTemplate"
CustomizationLabel The customization label. "Send Email"
visibilityPriority The visibility priority.
Ranges from -1000 for low to 1000 for high.
0
fileName The file name where the script is stored. Get(FileName)
scriptName The script name (or ID) to trigger when button is used.
Parameter to the script is the identifier.
"TouchBar SendEmail"
Expression Optional
An expression to execute when button is pressed.
""

Result

Returns OK or error.

Description

Adds a simple button.

Examples

Add a back button:

Set Variable [ $r ; Value: MBS( "TouchBar.AddButton"; $t; "PrevRecord"; ""; "NSImageNameTouchBarGoBackTemplate"; "Previous"; 0; Get(FileName); "PrevRecordTouchBar" ) ]

Add a next button:

Set Variable [ $r ; Value: MBS( "TouchBar.AddButton"; $t; "NextRecord"; ""; "NSImageNameTouchBarGoForwardTemplate"; "Previous"; 0; Get(FileName); "NextRecordTouchBar" ) ]

Add a plus button:

Set Variable [ $r ; Value: MBS( "TouchBar.AddButton"; $t; "AddRecord"; ""; "NSImageNameTouchBarAddTemplate"; "Add"; 0; Get(FileName); "AddRecordTouchBar" ) ]

Add a delete button:

Set Variable [ $r ; Value: MBS( "TouchBar.AddButton"; $t; "DeleteRecord"; ""; "NSImageNameTouchBarDeleteTemplate"; "Delete"; 0; Get(FileName); "DeleteRecordTouchBar" ) ]

Add button to trigger data viewer:

Set Variable [ $r ; Value: MBS( "TouchBar.AddButton"; $t; "DataViewerButton"; "DataViewer"; ""; "DataViewer"; 0; ""; ""; "MBS(\"Menubar.RunMenuCommand\"; 49297)" ) ]

Add button to trigger debugger:

Set Variable [ $r ; Value: MBS( "TouchBar.AddButton"; $t; "DebuggerButton"; "Debugger"; ""; "Debugger"; 0; ""; ""; "MBS(\"Menubar.RunMenuCommand\"; 49260)" ) ]

See also

Example Databases


Toolbar.Unregister   -   TouchBar.AssignToApp

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins