Is it possible to directly manipulate the control of a window from autokey?

21 views
Skip to first unread message

Zhe Lee

unread,
Feb 7, 2022, 8:37:32 AM2/7/22
to autokey-users
My situation is I use audio-recorder a lot. But when I start it the source device always set wrong, so I wander if there is a way to click on the source device setting button and choose the right item which contains the right text of my microphone name?2022-02-07_21-37.png 2022-02-07_21-35.png

William Morris

unread,
Feb 7, 2022, 12:36:17 PM2/7/22
to autoke...@googlegroups.com
Yes. It's best when the position of the window is predictable. Have a look at https://autokey.github.io/lib.scripting.Mouse-class.html

On Mon, Feb 7, 2022 at 7:37 AM Zhe Lee <imleg...@gmail.com> wrote:
My situation is I use audio-recorder a lot. But when I start it the source device always set wrong, so I wander if there is a way to click on the source device setting button and choose the right item which contains the right text of my microphone name?2022-02-07_21-37.png 2022-02-07_21-35.png

--
You received this message because you are subscribed to the Google Groups "autokey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to autokey-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/autokey-users/3eae633a-6003-4c1d-81a8-efa3a578a296n%40googlegroups.com.

jos...@main.nc.us

unread,
Feb 8, 2022, 5:05:31 PM2/8/22
to autoke...@googlegroups.com
Audio-recorder is very nice, but sometimes its settings are confusing.

General approach: Yes, it can be done, but it may take some work.

With any problem like this, first solve it by doing the process manually
and taking notes of each step. Then you can replace the steps with AutoKey
API calls in a script. See:
https://github.com/autokey/autokey/wiki/API-Examples .

Start by trying to do everything with your keyboard because that's a lot
easier to emulate than using the mouse. You can use keys like Home, Tab,
and your directional arrow keys to get to the fields you need to affect.

Sometimes pressing Enter on a field or button will do what you want.
If not, then you're stuck using the mouse which is harder because you have
to figure out the coordinates on the screen where you want to click as
your keyboard commands won't move the mouse cursor.

This is further complicated if you are dealing with a floating window that
may not always appear at the same location on your screen.

Worst case is that you would have to use our Xautomation integration which
allows you to search the screen for a small saved image like a picture of
the desired button and click the mouse on it.

https://github.com/autokey/autokey/blob/master/new_features.rst#click-on-or-move-pointer-to-an-area-that-can-be-identified-with-an-image

This isn't particularly well documented, but we can figure it out as we go
if you get stuck.

See how far you can get with all of the above and we'll take it from there.

Joe
Reply all
Reply to author
Forward
0 new messages