I am working with Numbers spreadsheet files whose final output must be in German. The source of the data is the Apple Configurator app (via Automator), which produces everything in English despite the German regional settings applied to the user account... that's just a tiny bit of background.
I have found some AppleScript to help with this already.
tell application "Numbers"
tell front document's active sheet
tell (first table whose selection range's class is range)
repeat with c in column "B"'s cells
tell c to if its value contains "TRUE" then ¬
set its value to my SUBSTITUTE(its value, "TRUE", "RICHTIG")
end repeat
end tell
end tell
end tell
to SUBSTITUTE(str, f, r)
set text item delimiters to f
set temp to str's text items
set text item delimiters to r
return temp as string
end SUBSTITUTE
This can be easily reapplied to deal with other words in the column that I am interested in.
Can somebody though help me with modifying this so that it can also change the background colour of the cell? So for example, if "TRUE" is in a given cell (in a particular column) it will get changed to "RICHTIG" and the background will then change to light green?
Likewise for "FALSE" to be changed to "FALSCH" and a light-red background colour.
I"ve tried already with "set its background colour to "green" for example, on a new line right after set its value to my SUBSTITUTE(its value, "TRUE", "RICHTIG") but it throws the error "A identifier can’t go after this identifier"
I shoudl also stress that the all the columns have their "data type" already set to "text"
Thanks.
WL