That whole chunk returned some errors so had to break it down. Final version of my volume/brightness value/indicator if anyone else will find it useful:
tell application "BetterTouchTool"
set volumelvl to (get_number_variable "OutputVolume") * 100 as integer
set brightval to word 10 of (do shell script "/usr/libexec/corebrightnessdiag status-info | grep -w DisplayServicesBrightness")
set brightlvl to brightval * 100 as integerend tell
if volumelvl is equal to 100 then
set volumelvl to "Max" as string
else if volumelvl is greater than or equal to 10 then
set volumelvl to volumelvl & "%"
else if volumelvl is less than 10 then
set volumelvl to text -2 thru -1 of ("0" & volumelvl) & "%"
end ifif brightlvl is equal to 100 then
set brightlvl to "Max" as string
else if brightlvl is greater than or equal to 10 then
set brightlvl to brightlvl & "%"
else if brightlvl is less than 10 then
set brightlvl to text -2 thru -1 of ("0" & brightlvl) & "%"
end ifreturn "{"text":"
" & volumelvl & "\n:sunny: " & brightlvl & ""}"