Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Assigns the TouchBar to be the one used with the given window.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
TouchBar | 6.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
Parameter | Description | Example |
---|---|---|
TouchBarRef | The reference number for the touch bar. | $TouchBar |
WindowRef | Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. | 0 |
Returns OK or error.
Build TouchBar for Window:
#Create a new TouchBar
Set Variable [$t; Value:MBS( "TouchBar.Create" )]
#Add two buttons
Set Variable [$r; Value:MBS( "TouchBar.AddButton"; $t; "PrevRecord"; ""; "NSImageNameTouchBarGoBackTemplate"; "Previous"; 0; Get(FileName); "PrevRecordTouchBar" )]
Set Variable [$r; Value:MBS( "TouchBar.AddButton"; $t; "NextRecord"; ""; "NSImageNameTouchBarGoForwardTemplate"; "Previous"; 0; Get(FileName); "NextRecordTouchBar" )]
#Set which button show by default:
Set Variable [$r; Value:MBS( "TouchBar.SetDefaultItemIdentifiers"; $t; "PrevRecord¶NextRecord¶NSTouchBarItemIdentifierOtherItemsProxy")]
#Set the primary button:
Set Variable [$r; Value:MBS( "TouchBar.SetPrincipalItemIdentifier"; $t; "NextRecord" )]
#Set which buttons can be configured:
Set Variable [$r; Value:MBS( "TouchBar.SetCustomizationAllowedItemIdentifiers"; $t; "PrevRecord¶NextRecord")]
#Assign touchbar to current window:
Set Variable [$r; Value:MBS( "TouchBar.AssignToWindow"; $t; 0 )]
Created 1st November 2016, last changed 3th November 2016
TouchBar.AssignToApp - TouchBar.Available
Feedback: Report problem or ask question.