AppleScript Font

Hello,


Using AppleScript it's possible to set or change the font type of cells, it takes a script quite some time to change the font in - for example - 1000 cells.

Would anybody know the code to change the font type before creation of a table or cells?

Or even the code to change the default font of a Numbers-document (without using a template by preference)?


Kind regards.

MacBook Pro (17-inch 2.4 GHz), OS X Mavericks (10.9.4)

Posted on Sep 3, 2014 1:51 AM

Reply
5 replies

Sep 3, 2014 7:24 AM in response to DeSignature

code to change the font type before creation of a table or cells?


I think the only way to do that is to set up a template with the desired font name and font size and have your AppleScript apply that template when creating a document.


You've probably discovered that when you have an existing table you have to target a cell or a range when changing the font. For example, to change the font of all of the cells in a table you could do something like this:


tell application "Numbers"
  tell document 1's active sheet
  tell table 1
  set cells's font name to "Georgia"
  end tell
  end tell
end tell



SG

Sep 3, 2014 7:49 AM in response to DeSignature

Thanks for the link! That code seems to do the same thing: it applies the font name to all the cells in an existing table. As far as I can tell, "cells's font name" is equivalent to "font name of cell range" and your "font name of every cell." On my setup I can't detect much speed difference: a bit slow no matter how it's done!


SG

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.

AppleScript Font

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