tell application "indigoserver"
log "start the server"
end tell
run application "Indigo 6"
delay 10
set checkFailed to true
repeat while checkFailed is equal to true
try
tell application "IndigoServer"
log "Startup check"
end tell
set checkFailed to false
-- display dialog "IndigoServer running properly!"
on error errStr number errorNumber
if errorNumber is equal to -600 then
set checkFailed to true
-- display dialog "Restart IndigoServer!"
try
tell application "Indigo 6"
quit
end tell
end try
try
tell application "System Events"
set ProcessList to name of every process
if "IndigoServer" is in ProcessList then
set ThePID to unix id of process "IndigoServer"
do shell script "kill -KILL " & ThePID
end if
end tell
end try
delay 5
try
run application "Indigo 6"
delay 10
tell application "Indigo 6"
quit
end tell
end try
end if
end try
delay 10
try
tell application "IndigoServer"
log "Startup check"
end tell
set checkFailed to false
-- display dialog "IndigoServer running properly!"
on error errStr number errorNumber
if errorNumber is equal to -600 then
set checkFailed to true
end if
end try
end repeat
tell application "Indigo 6"
quit
end tell
davinci wrote:Can't Indigo just check if it is running correctly and restart the server until it works?
sudo killall -9 appleeventsd
/Library/Application Support/Perceptive Automation/Indigo 7/
/Library/Application Support/Perceptive Automation/Indigo 6/
[etc]
tell application "IndigoServer-x"
set Energy_dagconsumed to (value of variable "Electra_dag" as number)
set value of variable "EnergyCostPerDay" to (Energy_dagconsumed * 0.23) as string
end tell
v1 = float(indigo.variables["Electra_dag"].value)*0.23
indigo.variable.updateValue("EnergyCostPerDay",str(v1))
Users browsing this forum: No registered users and 1 guest