Combining hotkeys in one file #711
Replies: 5 comments 16 replies
-
No. It wasn't designed that way. AutoKey is far more powerful than AHK because it gives you the full power of Python for scripting instead of a special purpose language/syntax. However, this power comes with a bit of added complexity, e.g. the separate metadata files. I don't know why the design approach to use separate metadata files rather than some sort of database was taken. It's just a feature of the original implementation of AutoKey. #699 was recently requested which would help a little in this regard by letting you sort the entries in various orders, e.g. by hotkey, making it easier to look for conflicts, etc. If you find too much clutter in a folder, AutoKey supports defining new subfolders so you can split things up into more manageable subsets. Additional folders can also be defined at arbitrary locations outside of AutoKey's configuration subtree. (If you do that, it works best to add the new folders to AutoKey as empty folders and then add the content to them after AutoKey already knows about the folders.) However, the metadata files are all human readable plain text JSON files with the If you have some familiarity with a scripting language such as bash, it would be relatively easy to write (CLI) scripts to examine these files and extract all sorts of information from them and present it in a form that would help you solve issues. I do a lot of bash scripting and would be happy to help with this if that approach interests you. If you are very careful and make good backups, it is also possible to edit these files manually or with CLI scripts. Any tools like this would be welcome additions to our wiki. Also, many file managers such as Dolphin have built-in search capabilities which may meet some of your needs and there are also tools such as recoll which provide advanced searching capabilities. If you join us over on Gitter, you could describe some of your specific problems that AutoKey and the above suggestions do not adequately address and maybe we can help you find solutions. |
Beta Was this translation helpful? Give feedback.
-
The keyboard.wait_for_keypress() API call would be useful for this, but it still needs some work since return codes aren't provided by AutoKey. It was reported in issue #659, which is still open, but there seems to be a link to a work-around if you'd like to give that a try. |
Beta Was this translation helpful? Give feedback.
-
I want to know how can I import clipboard and keyboard in external scripts (not directly in the autokey scripts). Then I can can put the common scripts in an external module and call them using autokey scripts binding with shortcut keys. Thank you! |
Beta Was this translation helpful? Give feedback.
-
If I understand you correctly, you basically want to use the Modules directory the way it ought to work, but doesn't. To do that now (or any time soon), you have to use the workaround in the feature request referenced above or do it with non-AutoKey tools such as xdotool (in a module/function in our Modules directory) because you can access them directly and don't need our API calls. |
Beta Was this translation helpful? Give feedback.
-
I misread what the second OP (@simprome) wanted the first time around and gave a purely-AutoKey solution. If I understand the request better now, @simprome would like to export clipboard and keyboard data to an external Python module file that can be used by AutoKey scripts or by any other Python script on the system. If that's the case, here's part of the code that would make that happen. It's a small demonstration of putting some text onto the clipboard, reading the clipboard, and then appending its contents to an external Python file (with optional instructions for overwriting that file, if desired). The example then opens the file and displays its contents in a dialog so we can see that it worked:
What's missing is instructions for using the module file from within AutoKey (although I believe that's covered in the wiki). I'm also not sure of what' meant by "keyboard" in the request. If that's in reference to the |
Beta Was this translation helpful? Give feedback.
-
In Autohotkey, one can have multiple shortcuts in
.ahk
. E.g:Autohotkey syntax looks more minimalistic than Autokey. I find this easier to debug, search and add. Does Autokey have a way to combine shortcuts instead of having piles of files cluttering
~/.config/autokey
each with a.json
.Beta Was this translation helpful? Give feedback.
All reactions