# How to find references to UI from python

**URL:** <https://forums.unrealengine.com/t/how-to-find-references-to-ui-from-python/226889>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [April 28, 2021, 7:42am UTC](https://forums.unrealengine.com/t/how-to-find-references-to-ui-from-python/226889 "2021-04-28T07:42:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jobim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jobim](https://forums.unrealengine.com/u/jobim)\
**Post date:** [April 28, 2021, 7:42am UTC](https://forums.unrealengine.com/t/how-to-find-references-to-ui-from-python/226889/1 "2021-04-28T07:42:19Z")

</div>

Hi, for example I know that to refer to Main menu I have to use this:  
menus = unreal.ToolMenus.get()  
main\_menu = menus.find\_menu(“LevelEditor.MainMenu”)

But how should I have discovered to use “LevelEditor.MainMenu”?  
What code do I have to see at?  
Thank you very much.

---

<div class="post-metadata">

**Author:** ![fxtd-odyssey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fxtd-odyssey](https://forums.unrealengine.com/u/fxtd-odyssey)\
**Post date:** [April 29, 2021, 11:30am UTC](https://forums.unrealengine.com/t/how-to-find-references-to-ui-from-python/226889/2 "2021-04-29T11:30:49Z")

</div>

```python
import unreal

def list_menu(num=1000):
    menu_list = set()
    for i in range(num):
        obj = unreal.find_object(None,"/Engine/Transient.ToolMenus_0:ToolMenu_%s" % i)
        if not obj:
            continue
        menu_name = str(obj.menu_name)
        if menu_name != "None":
            menu_list.add(menu_name)
    return list(menu_list)

print(list_menu())
LogPython: ['LevelEditor.LevelEditorToolBar', 'ContentBrowser.AssetContextMenu.LevelSequence', 'MediaPlayer.AssetPickerAssetContextMenu', 'ContentBrowser.AssetContextMenu', 'LevelEditor.LevelEditorToolBar.CompileComboButton', 'MainFrame.MainMenu', 'LevelEditor.MainMenu.Edit', 'LevelEditor.LevelEditorToolBar.BuildComboButton.LightingInfo.LightingResolution', 'LevelEditor.MainMenu', 'LevelEditor.MainMenu.File', 'AssetEditor.SkeletalMeshEditor.ToolBar', 'MainFrame.MainMenu.Edit', 'ContentBrowser.AssetContextMenu.CameraAnim', 'LevelEditor.MainMenu.Window', 'LevelEditor.LevelEditorToolBar.BuildComboButton', 'LevelEditor.LevelEditorToolBar.BuildComboButton.LightingQuality', 'MainFrame.MainMenu.File', 'LevelEditor.LevelEditorToolBar.BuildComboButton.LightingInfo.LightingDensity', 'LevelEditor.ActorContextMenu', 'ContentBrowser.AssetContextMenu.SoundWave', 'MainFrame.MainTabMenu.File', 'LevelEditor.LevelEditorToolBar.SourceControl', 'LevelEditor.LevelEditorToolBar.BuildComboButton.LightingInfo', 'LevelEditor.LevelEditorSceneOutliner.ContextMenu', 'MainFrame.MainMenu.Window', 'LevelEditor.LevelEditorToolBar.LevelToolbarQuickSettings', 'MainFrame.MainMenu.Asset', 'LevelEditor.LevelEditorToolBar.Cinematics', 'LevelEditor.MainMenu.Help', 'LevelEditor.LevelEditorToolBar.EditorModes', 'MainFrame.MainMenu.Help', 'ContentBrowser.FolderContextMenu', 'LevelEditor.LevelEditorToolBar.OpenBlueprint']

```

That’s the solution I found, pure python.  
I write a blog article for how to extend it [unreal python extend menu](https://blog.l0v0.com/posts/cad78e0d.html).

---

<div class="post-metadata">

**Author:** ![jobim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jobim](https://forums.unrealengine.com/u/jobim)\
**Post date:** [May 1, 2021, 5:22pm UTC](https://forums.unrealengine.com/t/how-to-find-references-to-ui-from-python/226889/3 "2021-05-01T17:22:59Z")

</div>

Wow Thank you very much.

---

<div class="post-metadata">

**Author:** ![betalulu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@betalulu](https://forums.unrealengine.com/u/betalulu)\
**Post date:** [October 18, 2024, 1:26pm UTC](https://forums.unrealengine.com/t/how-to-find-references-to-ui-from-python/226889/4 "2024-10-18T13:26:42Z")

</div>

For Unreal Engine 5.x you need to replace “/Engine/Transient.ToolMenus\_0:ToolMenu\_%s” with “/Engine/Transient.ToolMenus\_0:RegisteredMenu\_%s”
