Jump to content

How to fix JSON data error for input script filter

Recommended Posts

This is my error : 

[ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON:

input the



"input the" is the result of code "echo $userInput


This Alfred node, runs a script called search.rb. I've screen shotted it below as well. The script calls all redbooth API's(a project management app) Projects, Tasklists and tasks. It then runs a loop through each item and looks for titles that match the user input/ARGV. I have run the script locally in my terminal and the script returns the correct objects and should be printing them/returning to Alfred. However I get the above issue and I can't seem to figure out where my disconnect is.


Additional info/screen shots below.




search.rb/the script alfred runs to generate the script filter options.



This code(below/list_proj.rb) calls the redbooth API and takes all returned objects/projects and converts the data to json. When the script rubs as is in a alfred script node- it populates the filter options.

This code works to the desired effect. Posting for comparison



This is a snap shot of the work flow. Everything works with the exception of the Search function/nodes



Please let me know if I can provide anything else. I have a separate plugin that provides user auth for the work flow to access the redbooth client API. Any insights to this error or what I may have missed would be well appreciated. Thanks!


Share this post

Link to post

The output of you script should only be a JSON string, but you have "echo input $userInput" that send "input $userInput" (-> "input the") to stdout and just before the JSON string (which I assume output a correct JSON string). So, you should remove or comment this first line so it is not sent to Alfred.

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...