Jump to content

How to create simple Script Filter Python workflow

Recommended Posts

Good morning,


I'm currently trying to create a simple Script Filter Alfred 3 Workflow using Python. I found an earlier example which demonstrated how to pass XML results to a Python workflow:

xmloutput = """
<?xml version="1.0" encoding="utf-8" ?>
  <item arg="testitem">
    <subtitle>foo bar is a test item</subtitle>


My question is, what is the syntax for doing the same with the new JSON data structure?





Share this post

Link to post

I started my research on that post but I was struggling with the implementation. For XML, it seems as though you just Print() the XML object and Alfred parses it but I can't get the same to work with JSON. Is it the same approach?

Share this post

Link to post

Yes. Just print the XML/JSON string to STDOUT.


It's important that you print nothing else to STDOUT, or it will make your XML/JSON invalid.

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...