Applescript in numbers to set cell format to numbers with one decimal.
I have an OBDLink MX+ with generates CSV files.
I want to setup a script to automate the repetitive tasks associated with bringing the CSV file into numbers.
So far I have: (see script below)
I want to wrap all of the text in Row 2.
I also want to set most of the cell formats to numbers with one decimal place. There are a few variables that need three decimal places. The Grok 2 suggestions don't quite work
Current script
tell application "Numbers"
activate
try
-- get template names
set the templateNames to the name of every template
end try
tell table 1 of sheet 1 of front document
set header row count to 2
set header rows frozen to true
set header column count to 1
set header columns frozen to true
set the width of every column to 50
end tell
end tell
Grok2 mini suggestion
tell application "Numbers"
activate
tell document 1
tell sheet 1
tell table 1
-- Select the range or cells you want to change. Here, it's set for the entire table
-- If you want to change a specific range, replace 'every cell' with something like 'cell "A1:B10"'
tell every cell
set the format of value format of it to number format with value type number format with decimals 1
end tell
end tell
end tell
end tell
end tell
iMac 27″, macOS 12.7