RMPR / atbswp

A minimalist macro recorder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Repeat count setting: available on the main window?

dbitouze opened this issue · comments

Checklist

  • I use the latest release of atbswp
  • The issue is not existing yet

Verbose log

#!/bin/env python3
# Created by atbswp (https://github.com/rmpr/atbswp)
# on 05 Nov 2020 
import pyautogui
import time
pyautogui.FAILSAFE = False

pyautogui.moveTo(1087, 812)
pyautogui.mouseDown(565, 342, 'left')
pyautogui.mouseUp(565, 342, 'left')
time.sleep(2)
pyautogui.mouseDown(906, 338, 'left')
pyautogui.mouseUp(906, 338, 'left')
time.sleep(1)
pyautogui.mouseDown(829, 498, 'left')
pyautogui.mouseUp(829, 498, 'left')
time.sleep(1)
pyautogui.mouseDown(867, 651, 'left')
pyautogui.mouseUp(867, 651, 'left')
time.sleep(2)
pyautogui.mouseDown(941, 200, 'left')
pyautogui.mouseUp(941, 200, 'left')
time.sleep(1)

Miscellaneous information

Operating System

Linux Mageia 7

Desktop Environment/Window Manager

Plasma

Python version

Python 3.7.9

Description

I'm using (this nice!) atbswp to help me to remove spammer accounts from my site. The number of new spammers is variable so I often have to set the repeat count and that's a pain to each time have to:

  1. go to Preferences → Set Repeat Count,
  2. (set the repeat count),
  3. close the pop up (Esc doesn't work),
  4. play.

So it would be nice for the repeat count setting to be available on the main window and, preferably, with a "number box" (just as HTML <input> with type="number").

So it would be nice for the repeat count setting to be available on the main window and, preferably, with a "number box" (just as HTML <input> with type="number").
To be honest, I'm not really for this change because it seems to me like it will clutter the main window, which I want to keep very simple as it is.

Too bad! In certain use cases, this repeat count is likely to be set each time atbswp is used.

Moreover, I forgot: in my use case, once a capture has been played, it is in my interest to reset the repeat counter to 1, otherwise the next time the capture will be played, I would get into troubles. So I have once again to:

  1. go to Preferences → Set Repeat Count,
  2. (set the repeat count),
  3. close the pop up (Esc doesn't work),.

At least, what would be welcome are :

  • a shortcut to directly open the repeat counter setting popup,
  • a "number box", just as HTML <input type="number"> instead of the current <input type="range">: with the keyboard only, much more handy and precise than the mouse,
  • on the main window, an indicator of the number of repetitions.
  1. close the pop up (Esc doesn't work),
    Actually that's interesting for me. If Esc did work would it solve your problem?

Partially 😄

Also, did you try Alt+F4, what's the behaviour?

It is what I'm currently using but, IMO, this shortcut should be devoted to main windows only, not to popups.

Okay I think I get you. And the solution is actually pretty simple if you don't mind doing this without using the atbswps interface. You can modify manually the config file of atbswp. You can find it at ~/.config/atbswp.cfg just modify the value after repeat count and save, then rince and repeat. Let me know if that works for you.

In fact, no.

Let me explain more precisely my use case: the Website I manage, a French Q & A site devoted to LaTeX, is a victim of robots that register spammer accounts, sometimes up to 50 per day. If I don't delete these accounts in time, they manage to post questions which, as you can imagine, have nothing to do with the purpose of the site. So I keep a regular watch on the registrations and, several times a day, I delete a variable number of them: sometimes 3, sometimes 7, sometimes 1, etc. As these spammers are much more numerous than the real users, I can almost always delete them consecutively thanks to atbswp. So, several times a day, I open this application and I have to set the number of captures to launch, corresponding to the number of accounts to delete.

To conclude, setting the number of captures to be launched in the current interface is a bit tedious but going to set it in the configuration file ~/.config/atbswp.cfg would be even less convenient.

What I need is to be able to easily, once the application is open, set the number of captures to run.

Fair enough, but since I don't really agree with putting another thing on the main interface, I can at least create a keyboard shortcut to access this setting quickly. Will let you know how things are going.

Thanks. As I said, what would be welcome is, in addition:

  • a "number box": it will let the user run atbswp's capture the desired number of times with at most 6 keyboard actions:
    • 1 (shortcut to access this setting),
    • 3 (set the repetition counter: it is hopefully expected to be less than 1000 😄),
    • 1 (close the popup: Esc?)
    • 1 (not already said) run the capture (shortcut welcome),
  • either:
    • on the main window a (discrete) indicator of the number of repetitions,
    • or (not already said and preferably) for the repeat counter to be reset to 1 after atbswp is used, in order to not accidentally run the capture an excessive number of times the next time it is used (maybe not by default but with a global atbswp' setting).

I can also accept a PR from you if you're into that.

After a quick look at the code, I guess it would be beyond my scope (and, above all, I don't have the time at the moment): sorry.

There are already default shortcuts for running the capture (F9 by default I think) and to record (F12 I think) refer to the corresponding setting.

OK, nice!

From my perspective the general, predictive way of using the software is to keep the number of repetitions as previously set by the user.

I can understand, but wouldn't be possible for atbswp to provide a setting that let the user choose a number of repetitions:

  • either constant,
  • or reset to 1 after each run?

Hi there, just merged a PR with many commits addressing this issue (see #41). I finally settled to a few things:

  • Create a keyboard shortcut to access the repeat count setting (Ctrl+R)
  • All the settings dialog can now be closed using ESC
  • Beware of the repeat count dialog though, if you press ESC your changes won't be saved, you need to press Enter

That way you can as you requested modify the repeat count in less than 5 keystrokes most of the time. I also fixed the keyboard shortcuts for playback and recording, refer to the corresponding setting to see the values for your copy of atbswp (most likely F9 and F10).

I will make the v0.2 release very soon. I encourage you to test the latest updates on the master branch, and provide feedback about what you think.

I can understand, but wouldn't be possible for atbswp to provide a setting that let the user choose a number of repetitions:

either constant,
or reset to 1 after each run?

I won't move forward with this feature sorry. As mentioned in the previous post, since you can now access the setting quickly/easily, I think it kinda solves the problem.

Thanks for the PR! Seems to work nicely 😄

About the feature providing a setting that let the user choose a number of repetitions either constant or reset to 1 after each run, too bad! 😉 The worst thing is that I can't make atbswp record the reset to 1...

BTW, what about a (discrete) indicator of the number of repetitions on the main window?

I thought very much about this, the most obvious way for me to implement this, was to add it in the tooltip that appears on mouse hover on the button.

Mouse: not very handy. I avoid it as much as possible.

However, I'm not sure it will be helpful in your case,

No, indeed: what would be helpful is a visual reminder (for, e.g., not running 3 times when more than 1 time would be a disaster).

so I put this feature on hold while deciding the best way to implement.

Thanks!

* Create a keyboard shortcut to access the repeat count setting (Ctrl+R)

BTW, why the Ctrl prefix?

I don't know, to reduce the probability to accidentally press it I guess.

Indeed, but harmless, at least less risky than e.g. the single shortcut that plays back the capture.

Ikr, but in the case of playing back the capture it's configurable. And the default keyboard shortcut is hardly used these days.