Enabling keyboard shortcuts to confirm Dialogs in AppleScript - dialog

I am looking for a way to allow a user to complete a Dialog entry using keyboard shortcuts. Is this possible?
Other questions have discussed assigning shortcuts to the options in an AppleScript dialog box, but not to the "Continue"/"Okay" etc. button.
The main difficulty is that I'm using a multi-line text entry form, so the Enter button simply creates a new line, instead of targeting the default button as it would conventionally. I'm hoping cmdenter can be assigned to the default button instead.
The line of script defining the dialog in question is:
set theResponse to display dialog "Enter tasks:" default answer "
" buttons {"Cancel", "Continue"} default button "Continue"

Running your AppleScript code from Script Editor on a US English MacBook Pro, whether or not something is typed in, fnenter presses the Continue button.
The same keyboard shortcut works on an US English Apple Magic Keyboard when connected to the MacBook Pro and I'd assume any US English Mac it was connected to would do the same. I only have the MacBook Pro to test with at the moment.
In macOS, by default, pressing the tab key in this use case will not move between the controls as the controlling setting in System Preferences > Keyboard > Shortcuts is not set to allow it to act on all controls.
You must select one of the following options, depending on the version of macOS one is running, in order to use the tab key on all controls.
If you see:
Full Keyboard Access: In windows and dialogs, press Tab to move keyboard focus between:
(•) Text boxed and lists only
( ) All Controls
Select: (•) All Controls
If you see:
[] Use keyboard navigation to move between controls
Press the Tab key to move focus forward and Shift Tab to move focus backward.
Check: [√] Use keyboard navigation to move between controls
With this done, one can then use tabtabenter to press the continue button, with the dialog box produced by the code shown in the OP.
Side Note: One can also try fncommandenter as that was necessary from within a VMware macOS Catalina virtual machine that I also tested in.

⌘-Enter (on the numeric keypad) presses Continue

If you are in a multiline text field, hit the Tab key so that focus is on some element other than the text field. Then the Enter key should route properly to the dialog's default close button.

Related

How show and hide Win10 (tablet mode) virtual keyboard using Python

I need a way to show and hide the virtual keyboard on Win10 (TabTip.exe) because clicking on an entry field (Python and tkinter) it does not show itself. I know I can show it clicking on its icon in the system bar but I want it appears and disappears when needed. I found a key shortcut (win+ctrl+O) that opens it, I can use the keyboard module to send it but I did not find a shortcut to hide it. In tablet mode TabTip.exe is already running and the keyboard hidden.

Android studio "x" to close tabs hidden?

I had a colleague with a different keyboard layout work on my mac for 5 minutes and he pressed a lot of different (wrong) hotkeys.
Now the "x" in the file tabs are hidden and I can't use them to close files anymore.
How do I unhide the "x" ?
Enable Editor | General | Editor Tabs, Show "close" button on editor tabs:
Or use Help | Find Action (Cmd+Shift+A on Mac, Ctrl+Shift+A on Windows), start typing the option name, then press Enter to toggle:
Or use Search Everywhere (Shift+Shift with Show IDE Settings option enabled under the gear icon, Enter toggles as well, the lower entry opens Preferences at the corresponding page):

Sublime text 3 find and replace in selection without clicking the button

I'm using ST3 with vintage mode. When selecting some lines and pressing alt+shift+f (Mac OSX) I get the find and replace dialog at the bottom of the screen.
BUT, I have to remove my hand from the keyboard, reach for the mouse and click the little "In selection" button...
...is there some way for sublime to realize that I have made a selection and have that button clicked by default?
Try setting:
"auto_find_in_selection": true,
From my understanding, this will automatically use 'in selection' if you have non-empty selection when goes into find box.
[Edit]
Note, you generally set this settings in "Preferences.sublime-settings". You can open this setting by "Ctrl+Shift+P", and select "Preferences: Settings - User".

Move command in Dialog based aplications

I working on Dialog based applications once i right click on the Dialog Title bar a drop down list is coming with two options 1. Move and 2. Alt+F4 close. Once the User Press Move and he can able to drag the window as he desired and I add the On NC Hits Test to stop dragging its stopping normal dragging but it is not working in this particular context can any body help me in fixing this Bug.
When the user use the keyboard interface, he can move a windows with the arrow keys, without using the mouse.
If you want to limit the position of your dialog, process the WM_MOVING message.

What is the difference between a keyboard accelerator and a shortcut key?

What is the difference between a keyboard accelerator and a shortcut key?
John - I don't believe that is correct.
MSDN defines menus as having:
'Menu access keys' - the underlined letters in the menu item name.
'Menu shortcut keys' - the key combination to the right of the menu item.
It is menu shortcut keys (text to the right of the menu) that are identified as synonymous with keyboard accelerators, not menu access keys - see paragraph on Menu Shortcut Keys in the 'about menus' MSDN page - it is this section directs towards information on Keyboard accelerators, not the section on Menu Access Keys.
As far as I am concerned a keyboard accelerator is a 'shortcut key'. They may be used regardless of the visibility of a menu, and are only included in the menu as a reference for the user and a way for the user to pick up on shortcuts for menu items that they may regularly use. Hence they may be defined without being displayed in the menu at all.
See MSDN page on Keyboard Accelerators:
Typically, users rely on an
application's menus to learn the
command set and then switch over to
using accelerators as they become more
proficient with the application.
http://msdn.microsoft.com/en-us/library/ms646335(v=VS.85).aspx
Although accelerators typically
generate commands that exist as menu
items, they can also generate commands
that have no equivalent menu items.
http://msdn.microsoft.com/en-us/library/ms646335(v=VS.85).aspx
For Windows, a keyboard accelerator is represented by an underlined letter on a button, menu or other label:
keyboard accelerator http://content.screencast.com/users/TreefortJohn/folders/Jing/media/70d5002f-5832-448a-9379-256b7a8c4fd7/2009-01-12_2304.png
On recent versions of Windows, they are hidden until you press the Alt key. Then you can hit that letter to select the menu, button or other input control.
A shortcut key typically does not have a visual representation, except for when they're listed in menus. Ctrl-C, Ctrl-X, Ctrl-V are examples of common shortcut keys, which you can see listed next to their respective menu items.
About Keyboard Accelerators

Resources