Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Equivalent to "end macro" hotkey from QM2
#1
Has anyone coded an equivalent to the "end macro" that exists in under the optional settings in QM2?  I'll keep poking around myself, but if someone has some code to share, that would be awesome.

I've been a user of QM2 for a little over a year and have grown to love its functionality.  Now dipping my toes in AU and I'm even happier Smile.  Just having to fill some knowledge gaps with the internals, but making the switch pretty well so far.

Thanks to contributors!
#2
I was considering to add an "end" hotkey, but it has problems:
1. Can interfere with keys pressed by the script.
2. Does not work when the script is running not as admin and the active window is admin.
3. Does not work or is delayed if user input is blocked by an inputBlocker or keyboard hook. For example keys.send and similar functions block input by default.

Instead added two other ways to end a script. Both are inactive by default, but can be activated easily.

This is a script created using the default template (look in Options -> Templates), and added "show dialog" function:

C# code:
// script "" //.
script.setup(trayIcon: true);
//..

dialog.show("");

Add 2 arguments in script.setup (or one of them):

C# code:
// script "" //.
script.setup(trayIcon: true, sleepExit: true, lockExit: true);
//..

dialog.show("");

More info in script.setup help.

If want to add these arguments in all new scripts, you can do it in Options -> Templates.
#3
If I'm reading this right if I implemented "Lock Exit" it would abort if I did a Win-L and locked the desktop?

I figured out the template thing, that's slick.  I added #pragma warning disable168 to  get rid of unused Exceptions in try/catch blocks Smile

Thanks sir!  I'll give this a shot.


Forum Jump:


Users browsing this thread: 1 Guest(s)