I’ve been having a strange error with a myriad tables script. I set the rowsAltered variable to altered rows from the extended results then use an if statement on the variable.
if not rowsAltered = {} then
When rowsAltered = {} I get this AppleScript execution error in debug mode: “No result was returned from some part of this expression.”
Here’s the. thing, I tried to reduce it to the minimal with the sample below and it works just fine.
I’ve tried all sorts of ways of doing that conditional but I keep getting the same error.
I can tell by the logs and the variable watcher that the boolean is set correctly.
It doesn’t happen in run mode or in script editor, which makes me think it may have to do with pointers (although in every other aspect the script runs flawlessly in debug mode).
Any suggestions?
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
use script "Myriad Tables Lib" version "1.0.12"
-- This table has renamed buttons
set theTable to make new table with data {{true, "One"}, ¬
{false, "Two"}, ¬
{true, "Three"}, ¬
{false, "Four"}, ¬
{true, "Five"}} with prompt ("Note the new button titles") ¬
with row numbering
modify table theTable ¬
OK button name ("Continue") ¬
cancel button name ("Stop")
set tableResult to display table theTable ¬
with extended results
set rowsAltered to altered rows of tableResult
if not rowsAltered = {} then
return rowsAltered
else
return true
end if