# OpenMainToolbarPicker

> Opens the Main Toolbar picker, pre-filtered to a search term.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Toolbars](/engine/6000.7/script-reference/unityeditor/toolbars.md)
* **Assembly:** UnityEditor.CoreModule

## OpenMainToolbarPicker(string)

Opens the Main Toolbar picker, pre-filtered to a search term.

```csharp
public static void OpenMainToolbarPicker(string filter)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): An initial search filter for the picker. Pass an empty string or null for no filter.

### Remarks

Equivalent to calling [MainToolbar.OpenMainToolbarPicker](/engine/6000.7/script-reference/unityeditor/toolbars/maintoolbar/openmaintoolbarpicker.md) with [PickerMode.All](/engine/6000.7/script-reference/unityeditor/toolbars/maintoolbar/pickermode/all.md). The Main Toolbar picker stays open after each pick, so you can toggle several elements or menu item shortcuts in a row.

## OpenMainToolbarPicker(PickerMode, string)

Opens the Main Toolbar picker. The Main Toolbar picker is a search window you can use to find and toggle toolbar elements and menu items.

```csharp
public static void OpenMainToolbarPicker(MainToolbar.PickerMode mode = PickerMode.All, string filter = null)
```

### Parameters

**** (\[PickerMode]\(/engine/6000.7/script-reference/unityeditor/toolbars/maintoolbar/pickermode)): Which tab the picker opens to. Refer to [MainToolbar.PickerMode](/engine/6000.7/script-reference/unityeditor/toolbars/maintoolbar/pickermode.md). Defaults to [All](/engine/6000.7/script-reference/unityeditor/toolbars/maintoolbar/pickermode/all.md).**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): An initial search filter for the picker. Pass an empty string or null for no filter.

### Remarks

The Main Toolbar picker stays open after each pick, so you can toggle several elements or menu item shortcuts in a row. Use [MainToolbar.PickerMode](/engine/6000.7/script-reference/unityeditor/toolbars/maintoolbar/pickermode.md) to open directly on toolbar elements or menu items only, or leave it at the default to show everything together.

### Examples

```csharp
using UnityEditor;
using UnityEditor.Toolbars;

public class MainToolbarPickerExample
{
    // Opens the picker filtered to just this package's own toolbar elements, so users
    // can find and pin them without wading through everything else in the picker.
    [MenuItem("Examples/Open My Package's Toolbar Elements")]
    static void OpenPickerForMyPackage()
    {
        MainToolbar.OpenMainToolbarPicker(MainToolbar.PickerMode.ToolbarElements, "My Package Name");
    }
}
```
