Selecting Pop Up Menu Buttons in AppleScript

Entitize

I want to automate clicking a specific pop down menu's item. For Example, I want to change the Value of "Message receive Sound" to something else. How can I do this with AppleScript? And how can I do this with other pop down menus in AppleScript?

(To open the iMessage Settings menu, shown in the image, type CMD COMMA, once you open iMessage)

Note: I have successfully done this Automator, I just want to do it in applescript.

enter image description here

vadian

It's called GUI scripting. You have to identify the reference to the UI element(s).

GUI scripting strongly depends on the system version. If an update changes the UI structure the script will brake.

This selects the sound "Popcorn" in the sound popup menu. It's for El Capitan. In systems < 10.11 the UI elements may be different and the process name might be "iChat"

tell application "System Events"
    tell process "Messages"
        set frontmost to true
        if not (exists (1st window whose value of attribute "AXIdentifier" is "MessagesPreferencesWindow")) then
            keystroke "," using command down
            repeat until exists (1st window whose value of attribute "AXIdentifier" is "MessagesPreferencesWindow")
                delay 0.1
            end repeat
        end if
        tell (1st window whose value of attribute "AXIdentifier" is "MessagesPreferencesWindow")
            tell pop up button 4 of group 1
                click
                delay 0.2
                click menu item "Popcorn" of menu 1
            end tell
        end tell
    end tell
end tell

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Selecting Pop Up Menu Buttons in AppleScript

From Dev

Selecting an item from pop-up menu

From Dev

closing pop up with AppleScript

From Dev

AppleScript - how do I select a menu item in a pop up button that has no title?

From Dev

How to turn off the pop up selecting menu when holding a key in MacBook

From Dev

vim custom pop up menu

From Dev

Idea on implementing the following pop up menu in ListView

From Dev

Pop-up menu and graph focus in Matlab

From Dev

Dynamic Pop-Up Menu Android Studio

From Dev

Xcode - How to make a pop up menu

From Dev

How to use a pop-up menu in iOS?

From Dev

pop up menu with long press gesture

From Dev

How to add a pop up menu in LibGDX?

From Dev

Tab index with bootstrap pop up modal menu

From Dev

Retrieving dynamic pop up menu items

From Dev

Printing out variables in a pop up menu

From Dev

Codename one Toolbar command to pop up menu

From Dev

How to close / cancel a pop-up modal / dialog window in Applescript

From Dev

Making a pop up modal using dynamically created buttons / divs

From Dev

Making a pop up modal using dynamically created buttons / divs

From Dev

How to do styling on buttons on a message box pop-up

From Dev

Clicking sub menu pop up a modal in wordpress plugin

From Dev

Create a pop-up menu with right click about an object

From Dev

My pop up menu is not coming when my mail is sent

From Dev

How to change the text color and size of a pop up menu in android?

From Dev

Joomla - "Menu Item Type" pop-up is empty

From Dev

Set vertical size for the pop-up menu of a GtkComboBox

From Dev

Xcode pop up menu in build settings, how do I get there?

From Dev

My pop up menu is not coming when my mail is sent

Related Related

HotTag

Archive