Myriad Tables Error No result was returned from some part of this expression

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

Which boolean?

What happens if you use:

if rowsAltered is not {} then

That’s what I started with when the error first appeared. That’s the boolean I meant.

I’ve tried multiple versions of
if not rowsAltered then
Here’s what finally worked:

		--set anyChanges to (not rowsAltered = {}) 
		--if (anyChanges is true) then
		set anyChanges to (rowsAltered as list ≠ {}) as boolean
		if anyChanges then

The commented out lines were other tries that didn’t work

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.