Thanks deanishe, this has is very useful.
I have modified my script to `return JSON.stringify(result)`. When I run the script in terminal, I'm now getting the same JSON that appears to be correctly formatted for Script Filter.
$ ~/Documents/myscript.js list
{"items":[{"uid":"1","title":"OptA","autocomplete":"OptA","subtitle":"OptA","arg":"1"},{"uid":"2","title":"OptB","autocomplete":"OptB","subtitle":"OptB","arg":"2"}]}
However, I'm still getting the same error.
I have tracked the source of this to the following line. I'm obtaining the data to po