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!
The value of ‘background color’ for cells that have never been set to a color is ‘missing value’. Once set to any value, you cannot set them back to ‘missing value’ via AppleScript as it can’t be coerced to a type color. Choosing ‘No Fill’ under the Fill options does set ‘background color’ to ‘missing value’.
I don’t think setting the background color of a cell is doing what you describe above. It assigns the color to the cell. It doesn’t stack it on top of the existing fill. Perhaps this is just semantics and you just mean it is replacing the color fill with another color rather than your desire which is to have no color fill at all.
GUI scripting may allow you to choose the ‘no fill’ pull-down but I would suggest creating a spreadsheet template that you prefer and moving your data into a newly created, properly formatted sheet. Alternately you could shift the data down and right, out of the unwanted columns/rows and delete the gray-filled row and column from your existing spreadsheets.
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
set header column count to 0
set header row count to 0
end tell
Or if you still need them to function as header row and column, then:
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
set background color of row 1 to {65535, 65535, 65525}
set background color of column 1 to {65535, 65535, 65525}
end tell