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

Applescript Mac Numbers Help - Remove Color Fill

I'm trying to remove the color fill from the first column and row of CSV Numbers spreadsheet (why do they do this in the first place, maybe people don't want the first row and column in gray???) but cannot seem to figure out how to do it.


Someone here posted to use this:


delete background color of column "A" or set background color of column "A" to {65535, 65535, 65535}


but that only removes any overlay color already on top of the gray, or adds white on top of the gray. What I want to do is remove the color fill entirely, as if you had manually selected the row and column and chose "No fill" on the format panel.


Any help with this would be great!

Posted on Jun 29, 2023 7:37 AM

Reply

Similar questions

5 replies
Sort By: 

Jun 30, 2023 4:00 PM in response to mac_user_4ever

Copy and paste the following AppleScript into the Script Editor, click the compile button, and then click run. It will set the first gray filled column and row to white backgrounds, effectively reversing the default fill.


Assumption:

  • The Numbers spreadsheet is saved and not named Untitled. numbers.
  • The spreadsheet is already opened in Numbers


use scripting additions

tell application "Numbers"
	tell first table of active sheet of front document
		set selection range to column 1
		set background color of selection range to "white"
		set selection range to row 1
		set background color of selection range to "white"
	end tell
end tell
return


From:



To:


Reply

Jun 29, 2023 9:43 AM in response to mac_user_4ever

HI mu4,


The default grey fill is applied automatically only for rows and columns defined as Header rows and Header columns.


Inserting a new table to an existing Sheet can be done by clicking the 'Table' button in the tool bar.

This action opens the menu shown in the image below:


Clicking the middle table in the left column (with no grey-filled columns or rows) inserts the table shown behind the menu in the image above.


If the table you want does not require header row(s) or header column(s), choosing the this type will provide you with that type of table automatically.



You can also eliminate the grey fill by selecting the Table, opening the Table menu and choosing Header Rows…


Choose 0 from the list of numbers, and all Header rows on your table will be converted to 'body' rows, and will lose the grey fill (and the properties of Header row cells).


The same is true for Header Columns, using the Header Columns item, two steps below Header Rows in the menu.


Be aware, though, that without Header rows and/or columns, you will be unable to take advantage of the features built in to this type of rows and columns, including the ability to Freeze them, keeping those rows and columns visible when the rest of the table is scrolled up or left.


Regards,

Barry

Reply

Jun 29, 2023 11:51 PM in response to mac_user_4ever

mac_user_4ever wrote:

I can change the color to white, but would much prefer to remove it altogether, as if I had clicked on the No Fill menu option.


I've tried various ways, including setting background color to missing value. and trying to copy the background color from a body cell into the cell in the Header Row or Column. No joy.


This seems possible using gui-scripting but I think you might be better off just settling for white.


BTW, those Header Columns and Header Rows are highly useful in Numbers. But if you don't like them you can create a table the way you like it and File > Save as Template.


SG

Reply

Applescript Mac Numbers Help - Remove Color Fill

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