Import of python scripts

377 views
Skip to first unread message

Mr Green

unread,
Aug 18, 2010, 2:02:41 PM8/18/10
to autokey-users
I am trying to get my auto_tag script working, not being much of a
python coder is making it more difficult

So far I have autotag.py in my Scripts/ folder [added in autokey
prefs]

[code]

#! /usr/bin/python

def auto_tag(Start_text, End_text):

End_text_Len = len(End_text) + 2
keyboard.send_keys(Start_text + End_text)
keyboard.send_key("<left>", End_text_Len)
return autotag_string

[/code]

I think the keyboard.send is not working as its not part of script.
Also unsure if return statement is correct.

Think I need to remove keyboard stuff unless I can get it to load in
autotag, works fine in a normal script.

Hope it makes sense just a little stuck!

MrG

Chris Dekter

unread,
Aug 18, 2010, 8:18:10 PM8/18/10
to autoke...@googlegroups.com
My apologies, I should have thought of that when I gave you the advice earlier - you can't use AutoKey-specific stuff in the imported module (e.g. keyboard.blah, clipboard.blah etc). So this approach won't work for you. As it stands I don't see any other solution than to copy and paste the code into each instance you want to use it. You have the ability to duplicate a script in its entirety using the copy/paste item function in the UI, that should speed things up.
Reply all
Reply to author
Forward
0 new messages