- Posts tagged linux
- Explore linux on posterous
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.

