Jump to content

ClintonStrong

Member
  • Posts

    115
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by ClintonStrong

  1. Cool! I was hoping I'd see a timer workflow. Great job.

     

    Quick note: I think you might just be able to include growlnotify from your /usr/local/bin into the workflow folder, so it'll work regardless of whether or not it's installed. Alternatively, you could include terminal-notifier to use notification center. I'm not sure if there's a better way than that. Or you could just use AppleScript to send a growl notification, but I don't think there's support for Notification Center at this time without using terminal-notifier.

     

    One thing I'd like to see is support for hours as well as minutes, maybe in the form of "2h30m".

  2. As far as I know it's not possible to read the keyword. However, you could have each keyword run a bash script that sends a keyword to an applescript:

     

    osascript scriptname.applescript keyword

     

    You'd then just open the workflow folder and create the applescript file there. To get it to read the keyword, you'd use something like this:

     

     

    on run argv
        set theKeyword to item 1 of argv
    
        -- your script here
    end run

     

    It's not as elegant as I'd like, but hopefully it'll work for you.

  3. Search your tabs in Safari, Chrome, Chromium, Chrome Canary, and Webkit.

    Screen%20Shot%202013-01-19%20at%2012.42.

    When you action a result, it'll bring your browser to the front and switch to the selected tab. You can also close a tab by holding down alt when actioning a result.

    Download from Packal

     

    Updated Feb 8, 2014: Made it more resilient to an AppleScript error that could cause a blank output.

     

    Update #2, Feb 1, 2014: Fixed regression with searching. You should be able to search anchored by words (and capital letters in CamelCase words) again.

     

    Updated Feb 1, 2014: Rewrote the workflow. It now supports copying the URL of a tab, viewing a tab in QuickLook, and closing a tab with a modifier key.

     

    Updated Oct 11, 2013: Fixed issue with improper string encoding in Mavericks and Ruby 2.0 breaking the workflow.

     

    Updated Oct 9, 2013: Updated for Mavericks and Ruby 2.0.0. Removed thumbnails for now (beta versions of Safari don't seem to generate them anymore). Fixed some issues where the proper window wouldn't always focus correctly.

     

    Updated May 4, 2013: Experimental support for webpage thumbnails. Prevent launching browsers when WebKit is open.

    Updated Mar 26, 2013: (Hopefully) prevent launching browsers when it's not supposed to, and fix an issue with it not detecting WebKit.

  4. Just wanted to share a few quick tips for debugging. If you're using /bin/bash to run a script, you can add "2> error.log" to output errors to a file. Example:

    ruby script.rb "{query}" 2> error.log

     

    All errors will then be logged to error.log in your workflow's folder.

     

    Or if you want all output logged (perhaps so you can view the xml from a script filter), you could use tee:

     

    ruby script.rb "{query}" 2>&1 | tee output.log

     

    That'll log errors from stderr in addition to standard output. Note that PHP doesn't output to stderr, so if you're using PHP you'll have to check PHP's error log instead.

     

    Also, if you have any formatting errors in a script filters' XML, Alfred will log it to Console.app.

     

    Hope this helps, and feel free to share your own tips.

     

  5. I have a question. If I'm using the valid="no" attribute for an informational line, what can I do to make sure this line is always at the top of the list. Alfred is prioritising based on previous choices, but you're never going to actually select an informational line, so it's dropping down the list. Surely an info line needs to always go at the top of the list? Any way to control this?

     

    In another thread, Florian suggested using a timestamp as the uid. That way you get a different uid each time, which should prevent Alfred from remembering which results you select the most. Not a perfect solution, but if you just want to control the order of your results, it should work well enough.

  6. I think it only reorders after you action one of the results. I had the same problem, but removing ~/Library/Application Support/Alfred 2/Databases/knowledge.alfdb and relaunching Alfred results in them going back to the correct order.

     

    It'd be nice if there were a way for workflow developers to turn off Alfred's knowledge per extension, so we could sort results reliably. Maybe an attribute on the <items> tag?

  7. Ah, thanks, good to know.

     

    I spent most of my time trying to figure how to read the recent folders from Finder's plist (after lots of googling, I still had no idea what I was doing  ;)), so I sorta rushed through the workflow bits.

     

    Oh, and sorry for anyone looking at the applescript, as it's a bit of a mess. I'm working on cleaning it up and documenting it better, for anyone who's curious how it works.

     

    Edit: I've updated the workflow to clean up the applescript a bit, for anyone interested. I've updated the download URL in my original post, but I'll post it again for convenience: http://cl.ly/0V1G2x0B0I3Y

×
×
  • Create New...