Jump to content

Parse resulting output from file filter


Recommended Posts

I want to work with the two strings I see when I am using a file filter, but I don't knwo how I can access them in my workflow. I  found a Workflow that searches my Safari browsing history and opens the recently viewed URLs I've searched. Although this is not the functionality I want, it's a good starting point. In order to build a workflow that works I would need to parse the results as they are shown in the alfred window:

 

results.png

 

How can I access 1. and 2. in my alfred workflow? (Note, that 1. and 2. is relative to what the user is going to decide is the best result for his or her search.) There have to be tokens for this kind of thing, right?

Link to comment

Thanks for your reply, Vítor.

 

I did read some portion of the two posts you've mentioned, but I can't see how I can access these <title></title> <subtitle></subtitle> attributes for using them in, say, a workflow that takes the title and subtitle of my example and formats them in a markdown link and copys them to my pasteboard. I don't need to put stuff in my results that is not already found by the file filter, I want to use the info that is found and shown in the results. Maybe I've overlooked something, but it seems to me, that the two posts answer the question of how to get stuff in the results, whereas I want to accomplish the opposite.

Link to comment

I that case, what you want to look at is the arg attribute. The XML is purely to inform the formatting of the output in Alfred, it’s not supposed to actually do anything. What you do is build a script that does something with the arguments you give it, and then on the XML you use the arg attribute to feed it those arguments.

 

Check the posts again, and download the workflow from the first one, as it is simple and uses the arg attribute to pass along arguments.

You can also check my PinAdd, WatchList, and LabelColor workflows (links in the signature; “LabelColor” will probably the the easiest one to understand), for some real-world examples.

Edited by Vítor
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...