Closed csteinlehner closed 5 years ago
hs.execute
isn't returning a table but three actual results, so you should call it in one of the following ways:
output, status, termType = hs.execute('blueutil -p ' .. power, true)
-- or
result = table.pack(hs.execute('blueutil -p ' .. power, true))
The first puts the three return values into separate variables; the second packs the results into a table where output is in results[1]
, the status is in results[2]
, and the termination type is in results[3]
.
@asmagill Thanks for the insight. The first attempt with three variables didn't work for me, but the table.pack approach works just fine. Thanks for the help!
Hello,
it seems like
hs.execute
doesn't return anything. With this script, I just get an empty return.If I want to get some expected information from the result object (like output etc.), the script throws an error.
I call this script from
hs.caffeinate.watcher.systemWillSleep
event. Could this be an issue?Thanks for your help.