# PrefsMenuItem value/text

**URL:** <https://forum.xojo.com/t/prefsmenuitem-value-text/76902>\
**Category:** macOS\
**Created:** [August 15, 2023, 3:47am UTC](https://forum.xojo.com/t/prefsmenuitem-value-text/76902 "2023-08-15T03:47:10Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![TomE1](https://forum.xojo.com/user_avatar/forum.xojo.com/tome1/32/1940_2.png) [@TomE1](https://forum.xojo.com/u/TomE1)\
**Post date:** [August 15, 2023, 12:50pm UTC](https://forum.xojo.com/t/prefsmenuitem-value-text/76902/10 "2023-08-15T12:50:51Z")

</div>

I was able to get the menu title of Safari preferences (“Einstellungen…” on my German OS) via AppleScript

```auto
tell application "System Events" to tell process "Safari" to get title of menu item 4 of menu 1 of (menu bar item 2 of menu bar 1)

```

To check it use Apple’s “Script Editor” and replace “Safari” with your App´s name.

You can call is as shown [in this Post](https://forum.xojo.com/t/how-passing-a-variable-from-shell-to-applescript/70702/6).

Make sure that your App has permissions to send Apple Events e.g. as shown in [add a script in the Xojo Build](https://forum.xojo.com/t/xojo-not-getting-the-value-returned-by-the-applescript/73305/15)

---

_[View the full topic](https://forum.xojo.com/t/prefsmenuitem-value-text/76902)._
