phstc Posted January 6, 2014 Share Posted January 6, 2014 (edited) Hello I have some links which I use daily (they aren't in my Chrome bookmarks): Admin - http:// Production - http:// Log - http:// Hangout - http:// ... I would like to create a workflow i.e. "links" to show these links and filter them as I type, if I click in the link it should open the url in Chrome. I didn't find a similar example, all of them seemed too complex for what I want. Is there a simple way to create such workflow? Thanks Edited January 6, 2014 by phstc Link to comment
ctwise Posted January 6, 2014 Share Posted January 6, 2014 Create a new workflow. There's a template for opening a URL in a browser. Set a keyword, e.g., admin, and fill in the URL. Then add the same two blocks over and over again for each keyword and each URL. At the end you'll have a complete workflow with all of your keywords and URLs. Link to comment
phstc Posted January 6, 2014 Author Share Posted January 6, 2014 Nice, thank you. Is there a way to have only one keyword i.e. `links` which lists/filters all urls. Link to comment
ctwise Posted January 6, 2014 Share Posted January 6, 2014 Yes, but you'll have to write code. Create a workflow. Use a script filter and write code that lists the URLs and displays only the ones that match the query. Link to comment
phstc Posted January 8, 2014 Author Share Posted January 8, 2014 (edited) Right, I ended up with a script. https://github.com/phstc/alfred_links_workflow LINKS = { 'Pablo' => 'http://pablocantero.com', 'GitHub' => 'http://github.com/phstc' } query = '{query}'.strip.downcase if query == '' selected = LINKS else selected = LINKS.reject do |name, link| name.to_s.downcase.index(query).nil? end end output = %{<?xml version="1.0"?><items>} selected.each do |name, link| output += %{ <item uid="#{name}" arg="#{link}" autocomplete="#{name}"> <title>#{name}</title> <icon>link.png</icon> </item> } end output += "</items>" puts output Edited January 8, 2014 by phstc Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now