Autokey-GTK

I love playing with autokey-gtk, as it saves me a lot of keystrokes and helps improve my workflow. It’s also the main reason I will not be switching to any other OS like ChromeOS

I’ll try and post a few of my scripts once in  awhile, it uses python code so sky’s the limit.

Copy text, filter out jira ticket and open in new tab

This script selects all text, copies it to clipboard and then searches for a jira ticket. Once found, open a new tab, and paste the Jira URL.

(Siteops tickets start with SO-, adjust as needed)

import time
import re
keyboard.send_keys("<ctrl>+a")
keyboard.send_keys("<ctrl>+c")
time.sleep(0.25)
text = clipboard.get_clipboard()
m = re.search("(SO-[0-9]+)", text)
if m:
 keyboard.send_keys("<ctrl>+t")
 keyboard.send_keys("https://jira/browse/%s" % m.group(0))
 keyboard.send_keys("<enter>")

GMail to doit.im or any other mail based task manager

This one is simple, copy the URL from the browser and forward the mail to my task manager with the Gmail url pasted into it, that way I can always get back to the original mail when working on the task.

# Script to copy URL and forward mail with URL included
import time
keyboard.send_keys("<ctrl>+l")
time.sleep(0.25)
keyboard.send_keys("<ctrl>+c<tab>f")
time.sleep(0.25)
keyboard.send_keys("changeme@doitim.in<tab>")
time.sleep(0.50)
keyboard.send_keys("<tab><tab>")
time.sleep(0.25)
keyboard.send_keys(clipboard.get_selection())
time.sleep(0.50)
keyboard.send_keys("<enter><tab>")
keyboard.send_key("<enter>")

Leave a Reply

Your email address will not be published. Required fields are marked *