Set Bold/Italic with AppleScript in Numbers?

I am using AppleScript to set the font of cells in a Numbers document. I can set the basic font (e.g., "Helvetica", "Times New Roman"), but I can't style the text (e.g., "Helvetica Bold", "Times New Roman Italic").


Is there a way to style Numbers cells with AppleScript as bold or italic? If so, how is it done? Thanks.

iMac, 27" Late 2013

Posted on Jan 30, 2018 8:32 PM

Reply
1 reply

Jan 31, 2018 6:25 AM in response to Laguna Hiker

This seems to work for me:


tell application "Numbers"

set font name of cell "B2" of table 1 of sheet 1 of document 1 to "HelveticaNeue-Bold"

end tell


The trick seems to be to use the condensed name of the font - the easiest way to do this is to set a cell to the font you want then use AppleScript to 'get font name of cell...' and examine the result, or use the Font Book application to get info on the font and use the 'Postscript name'.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Set Bold/Italic with AppleScript in Numbers?

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