Here's the code:
- Code: Select all
set LIGHT_SENSOR_ANALOG_RAW to value of variable "A1LightRaw"
set lightLevel to ((1023 - LIGHT_SENSOR_ANALOG_RAW) / 10.23)
set value of variable "A1Light" to lightLevel & "%"
I get an error:
- Code: Select all
Error script error: around characters 123 to 174
Error script error: A descriptor type mismatch occurred. (-10001)
Looks like AppleScript doesn't like the variable...seems like it's a string and not a true numeric.
What's the best way to convert the value from string to numeric?