You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

Applescript Keynote Selection Range

This script fails with "Can’t make \"A5:D5\" into type range." 

activate application "Keynote"

tell application "Keynote"

tell the front document

tell the current slide

set auction to make new table

tell auction

set selection range to "A5:D5"

tell application "System Events"

tell application process "Keynote"

click menu item "Merge Cells" of menu "Table" of menu item "Table" of menu "Format" of menu bar item "Format" of menu bar 1

end tell

end tell

end tell

end tell

end tell

end tell

A command to merge a range of cells directly without UI scripting fails, so I tried this.

Posted on Mar 27, 2021 7:02 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 29, 2021 2:19 PM

Digging in a little deeper:


> A command to merge a range of cells directly without UI scripting fails, so I tried this


This is still doomed to failure as is, because these cells cannot be merged - either manually or via scripting.


That's because the default table style includes one header row and one header column. Header cells cannot be merged with 'regular' cells.


To merge these cells you have to nix the header column so that all the cells are of the same class. Try:


			tell auction
				set header column count to 0
				merge range "A5:D5"



Similar questions

3 replies
Question marked as Top-ranking reply

Mar 29, 2021 2:19 PM in response to Camelot

Digging in a little deeper:


> A command to merge a range of cells directly without UI scripting fails, so I tried this


This is still doomed to failure as is, because these cells cannot be merged - either manually or via scripting.


That's because the default table style includes one header row and one header column. Header cells cannot be merged with 'regular' cells.


To merge these cells you have to nix the header column so that all the cells are of the same class. Try:


			tell auction
				set header column count to 0
				merge range "A5:D5"



Applescript Keynote Selection Range

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