How to select a pop up menu item in a cell with AppleScript?

409 views Asked by At

I am learning to use AppleScript with Numbers application on my Mac. I have a spreadsheet with a cell "D1" which is a pop up menu preloaded with 3 items. I want to select the first item using AppleScript. How can I do that? Here is what I am using but it does not work properly as it removeds the pop up menu from cell D1:

on run {input, parameters}
tell application "Numbers"
    activate
    tell the first table of active sheet of document 1
        set item_list to {"Select", "Apples", "Oranges"}
        set the value of cell "D1" to item 1 of item_list
    end tell
end tell
return input
end run

I still want the cell D1 stays as a pop up menu with all 3 items but after running the script, the cell D1 becomes a regular cell holding the value of item 1.

0

There are 0 answers