user script: creating multiple phrases/scripts from a script

31 views
Skip to first unread message

Ciro Santilli

unread,
May 12, 2012, 7:02:32 AM5/12/12
to autoke...@googlegroups.com
Hi there,

I have made a script that allows you to create multiple scripts of phrases from a script, with some script factoring out:

i.parse_store("""hp
^+a cnta
^+b cntb
^+c cntc
^+d cntd
^#!+e cnte
""")

i.set_trigger_immediately(True)
i.set_abbreviation_sufix(';')
i.parse_store("""as
abr1
    # This is a python script.
    # INDENT EACH LINE BY EXACTLY 4 SPACES!!
    keyboard.send_keys("cnt1")
return

abr2
    keyboard.send_keys("cnt2")
keyboard.send_keys(" cnt3 continued")
return
""")

To use:

- Put the item_creator found HERE in your import path (Edit > Preferences > Script Engine)
cd YOUR_IMPORT_PATH
wget https://raw.github.com/cirosantilli/python/274996f02ae1a2e6fbcf36bcd67eb71095fb0caf/autokey/item_creator.py

- check that the
PATH_TO_YOUR_AUTOKEY_LIB = "/usr/share/pyshared/autokey"
actually points to your autokey installation (should contain things like scripting.py, model.py, etc.)

- Use the test script
https://raw.github.com/cirosantilli/python/274996PATH_TO_YOUR_AUTOKEY_LIB = "/usr/share/pyshared/autokey"f02ae1a2e6fbcf36bcd67eb71095fb0caf/autokey/item_creator_tutorial.py

- restart Autokeys (Control + Q) after using the script

To come:

- no more need for restarting GUI
- more factoring out options!

If you find it is interesting enough I will submit a patch with this included inside Autokey.

Chris D

unread,
May 14, 2012, 10:12:01 PM5/14/12
to autoke...@googlegroups.com
Nice :)
Reply all
Reply to author
Forward
0 new messages