Pass information to a script

378 views
Skip to first unread message

Mr Green

unread,
Aug 17, 2010, 1:33:55 AM8/17/10
to autokey-users
I am currently using this script [I found so not my work!]

firstPart = "<img>"
secondPart = "</img>"
keyboard.send_keys(firstPart + secondPart)
keyboard.send_key("<left>", len(secondPart))

It works fine but for every tag I wish to create I have to rewrite the
whole code

Not sure if Autokey will allow def() so I could pass tags I need

Something like

def auto_tag( open_tag, close_tag)
keyboard.send_keys(open_tag + close_tag)
keyboard.send_key("<left>", len(close_tag))

Will autokey allow me to pass tags to auto_tag script? or am I way out
of my depth?

MrG

Chris Dekter

unread,
Aug 17, 2010, 3:28:09 AM8/17/10
to autoke...@googlegroups.com
If you create the auto_tag function in a separate Python module (e.g. tag.py) and place it in your user module folder (as configured under preferences in AutoKey), then yes. You will need to restart AutoKey for the new .py file to be picked up.
Reply all
Reply to author
Forward
0 new messages