- Code: Select all
set theDate to (current date) as string
set hourWord to word 5 of theDate as integer --hour
set minWord to word 6 of theDate as integer --minute
set apWord to word 8 of theDate --AM or PM
set theHour to hourWord * 100 + minWord
if (apWord = "PM" and hourWord ≠ 12) then set theHour to theHour + 1200
if (apWord = "AM" and hourWord = 12) then set theHour to theHour - 1200
-- add leading zero if necessary
set minWordString to minWord as string
set theLength to the length of minWordString
if theLength = 1 then
set minWord to "0" & minWord as string
end if
set theClock to (hourWord as string) & ":" & minWord as string
set theDay to text 1 thru 3 of theDate
tell application "IndigoServer"
set value of variable "TimeNow" to (current date) as string
set value of variable "TimeNow2400" to theHour
set value of variable "ClockTime" to theClock
set value of variable "DayShort" to theDay
end tell
It returns this error:
Error script error: around characters 77 to 84
Error script error: Can’t make "at" into type integer. (-1700)
Appreciate any help with a fix.
Thanks,
carl