Autokey Python Script - Text Filter Template

This script can be used to start off... replace the content = content in the center with some code to modify the text.

# Get selection
keyboard.send_keys("<ctrl>+c")
content = clipboard.get_selection()

# Process Selection
content = content

# Replace Selection
clipboard.fill_clipboard(content)
keyboard.send_keys("<ctrl>+v")

AutoKey - Python Script to Sort Simple Lists

I've started using AutoKey, a beautiful application that gets out of your way and lets you run Python scripts to generate text, filter or modify selected text... or in the most basic form, lets you type out large amounts of repetitive text with few keystrokes.

While looking for interesting scripts, I came across a simple problem - of sorting a grocery list alphabetically. Here's the discussion: http://groups.google.com/group/autokey-users/browse_thread/thread/b0bbd13166bd25ad

And here's the solution that works:

keyboard.send_keys("<ctrl>+c")
content = clipboard.get_selection()
content = content.split('\n')
content.sort()
content = '\n'.join(content)
clipboard.fill_clipboard(content)
keyboard.send_keys("<ctrl>+v")


I haven't posted it there yet because I'll have to sign up for the mailing list, which I'm not too keen on doing just yet.

Anyway, such simple scripts are a great time saver. And I hope to publish more of them as I implement and refine for my own use. You can bookmark the tag "autokey" to get more as I post, or better, subscribe to the blog ;)