Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to update popup (drop down) cells in Numbers using Applescript

I understand that the list popups (dropdown lists in cells) cannot be dynamic in Numbers.


I have the same dropdown list in multiple cells and tables, and this list often needs to be changed. Its not practical to amend one list, then copy/paste it into 200 plus cells that require the dropdown facility (they are not in sequential rows).


Can Applescript be used to do the copy/paste function, as i could specify the cell ranges. My simple attempt only managed to copy/paste the cell values rather than the dropdown/popup list.


Any constructive help would be appreciated.


Thanks.

Numbers-OTHER, OS X Mountain Lion (10.8)

Posted on Sep 26, 2013 11:22 AM

Reply
18 replies

Sep 29, 2013 5:48 AM in response to Hiroto

Hello


I just noticed the script may occasionally fail due to timing issue of GUI scripting. It will be safer to add a small delay in _delete() handler inside set_popup_items_from_range() handler such as -


        on _delete()
            (*
                virtual key code:
                    kVK_Delete    = 0x33    (51)
            *)
            tell application "Numbers" to activate
            tell application "System Events"
                tell process "Numbers"
                    key code 51 -- delete
                end tell
            end tell
            delay 0.2 -- # adjust as needed
        end _delete


Regards,

H

How to update popup (drop down) cells in Numbers using Applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.