Jump to content

How to force a script filter to read (deprecated) XML formatted output?


dfay

Recommended Posts

I have an old unsupported 3rd party script filter that outputs Alfred XML & I don't have time or knowledge to rewrite the php to output JSON.  This was working fine until recently it started throwing the following error:

 

[10:16:47.624] ERROR: BibDesk Search[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set.

 

It seems Alfred has stopped recognizing the old deprecated XML.  Is there a way to force a script filter to still use the legacy XML processor instead?

 

https://www.alfredapp.com/help/workflows/inputs/script-filter/xml/ for background. 

Link to comment
12 minutes ago, dfay said:

I have an old unsupported 3rd party script filter that outputs Alfred XML

 

Have you checked what the Script Filter is actually outputting? It sounds like it's generating neither valid XML nor valid JSON.

 

Alfred still supports XML (the Getting Started > Script Filter demo workflow still works).

Link to comment

Yeah I subsequently tried the demo & it works for me.

 

Here's the output - looks fine to me.

 

<?xml version="1.0"?>
<items><item uid="bib/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Cannon-2010a.bdskcache" arg="/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Cannon-2010a.bdskcache"><title>Vulnerability, resilience and development discourses in context of climate change</title><subtitle>article, 2010: Cannon, Terry; Mu&#x308;ller-Mahn, Detlef</subtitle><icon>icon.png</icon></item><item uid="bib/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/McMullin-2016a.bdskcache" arg="/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/McMullin-2016a.bdskcache"><title>Cancer and the Comics: Graphic Narratives and Biolegitimate Lives</title><subtitle>article, 2016: McMullin, Juliet</subtitle><icon>icon.png</icon></item><item uid="bib/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Marianne-Bertrand-2005a.bdskcache" arg="/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Marianne-Bertrand-2005a.bdskcache"><title>Implicit Discrimination</title><subtitle>article, 2005: Marianne Bertrand, Dolly Chugh; Mullainathan, Sendhil</subtitle><icon>icon.png</icon></item><item uid="bib/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Mcmullin-2010a.bdskcache" arg="/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Mcmullin-2010a.bdskcache"><title>The Healthy Ancestor: Embodied Inequality and the Revitalization of Native Hawai'ian Health</title><subtitle>book, 2010: Mcmullin, Juliet</subtitle><icon>icon.png</icon></item><item uid="bib/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/McMullan-2002a.bdskcache" arg="/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/McMullan-2002a.bdskcache"><title>Lobster poaching and the ironies of law enforcement</title><subtitle>article, 2002: McMullan, J.L.; Perrier, D.C.</subtitle><icon>icon.png</icon></item><item uid="bib/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Muller-1987a.bdskcache" arg="/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Muller-1987a.bdskcache"><title>Transkei Livestock Census Data - by Magisterial District</title><subtitle>book, 1987: Muller, N.D.; Mpela, V.N.</subtitle><icon>icon.png</icon></item><item uid="bib/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Muller-1987b.bdskcache" arg="/Users/someusername/Library/Caches/Metadata/edu.ucsd.cs.mmccrack.bibdesk/Muller-1987b.bdskcache"><title>The Population of Transkei - by Magisterial District</title><subtitle>book, 1987: Muller, N.D.; Mpela, V.N.</subtitle><icon>icon.png</icon></item></items>
<!-- Time for searching: 0.80533909797668 sec-->
<!-- Total time: 0.80955910682678 sec-->
[10:16:47.624] ERROR: BibDesk Search[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set.

 

Edited by dfay
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...