Jump to content

gillibrand

Member
  • Posts

    9
  • Joined

  • Last visited

Posts posted by gillibrand

  1. I've added a hotkey, but I think it will get disabled by Alfred on import. You'll have to re-assign the key of your choice after importing. I set it to ctrl-shift-C initially.

    LaunchBar has an Instant Send feature for working with the selected text. Doesn't seem like Alfred has the equivalent.

  2. A workflow to change the case of text on the clipboard to uppercase, lowercase, or title case.

     

    changecase.png

     

    Source code and more details on GitHub.

    Or just download the workflow.

     

    ---

     

     

    4/19/2013
    - Always sorts the case styles in the same order now: lowercase, uppercase, then title case. (Removed the `uid` from results returned to Alfred as supported in Alfred 2.0.3.)
     
    4/6/2013
    - Title case will now leave common acronyms as uppercase (HTML, XML, etc.).
  3. The `arg` part of a script filter's result (the bit passed on as {query}) is oddly an XML attribute instead of an element. This makes it harder to pass on newlines in results--they just turn into spaces. The trick is to escape the newlines as an entity reference like:

     

    Most XML escape functions won't do that automatically, so you probably need to it yourself. Possibly double-quotes too. The best thing I came up with in Python is:

     

    from xml.sax.saxutils import escape
    
    safe_arg = escape(any_crazy_text, {'"': '"', '\n': '
    '} )
    

     

     

    I'd be happy to hear that there's a simpler way.

     

    Just passing this on since it stumped me at first.

×
×
  • Create New...