Dialog On Top + focus on OK button

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
ccris
Newbie
Posts: 19
Joined: Fri Aug 27, 2010 1:53 pm

Dialog On Top + focus on OK button

Post by ccris » Tue Mar 27, 2012 3:17 pm

Hello,

I am on a quest to eliminate unnecessary mouse clicks with the use of Mac Sch (clicks that repeat tens of thousands of times per year...).

In this case, I am replacing the "stock" INPUT> box with a dialog. The INPUT> command is great, but I have not figured out how to make it STAYONTOP or position it other than center screen. After box comes up, I need to do "stuff" that loses the focus from the INPUT box. One mouse click (that I am trying to eliminate) to bring it forward.

Based on examples, I have created a simple dialog that STAYSONTOP no matter what I do behind it (and I can position it). It has 1 text line (that goes to a variable), and an OK button. The "stock" INPUT box has a nice property: after you type in text you simply hit ENTER (OK button is permanently in focus). My dialog has focus on text line just typed. To press OK one must either mouse click OK (or TAB to OK +ENTER ).

I have not figured out (by reading the docs and the forum) how to make the OK button keep the focus so I can simply hit ENTER after I am done entering text (without the need to hit TAB or do a mouse click). As it is right now, by using the dialog I save one mouse click AND I lose one mouse click (which brings me back to the INPUT> box).

Can a dialog (with one text input line) be created to stay permanently ONTOP, with focus on OK button, such that after entering text one can simply hit ENTER (without another TAB or mouse click)?

Thanks,

CC

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 27, 2012 3:50 pm

Set the OK button's "Default" property to True. This makes it the default button so that it receives the Enter key. Now you don't need to click it. Just type into the edit box and hit Enter.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

ccris
Newbie
Posts: 19
Joined: Fri Aug 27, 2010 1:53 pm

Post by ccris » Tue Mar 27, 2012 5:10 pm

That was easy, and it works!
Thanks a bunch!

CC

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts