Date
1 - 18 of 18
Accelerator keys in displayed buttons
Jean-Christophe Helary <jean.christophe.helary@...>
I'm wondering if it's possible to set accelerator keys to access displayed buttons from the keyboard, instead of having to use the mouse.
For ex: buttons {"Action", "Reaction"} where hitting "A" on the keyboard would trigger "Action" and "R" "Reaction... Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com |
|
Robert Poland
Since accelerator keys “ are a PC function, I’m confused by your request. Are you using a Mac or a PC. Which model and OS.
If a Mac, look into Keyboard Maestro. https://www.keyboardmaestro.com/main/
Robert Poland
Fort Collins, CO |
|
Jean-Christophe Helary <jean.christophe.helary@...>
Sorry for the inappropriate term use.
I mean when you have a normal dialog on Mac and you can access the button with a keyboard combination without having to click on the buttons. Jean-Christophe Dec 24, 2017 22:58、Robert Poland <rpoland@...>のメール:Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com |
|
Jean-Christophe Helary <jean.christophe.helary@...>
Dec 25, 2017 2:40、Robert Poland <rpoland@...>のメール:Not on dialogs created with "display dialog". Or not on 10.13. Anyway, my "display dialog" buttons are stuck in the state I define and I can't move around them with the keyboard. Only when I define a cancel button is "esc" registered also to that button. Jean-Christophe On Dec 24, 2017, at 7:57 AM, Jean-Christophe Helary <jean.christophe.helary@...> wrote: |
|
Robert Poland
This script works as I said with OS10.13.2.
display dialog "See the pretty buttons!" buttons {"Cancel", "OK", "Some other button"} cancel button "Cancel" default button "OK"
Robert Poland
Fort Collins, CO |
|
Jean-Christophe Helary <jean.christophe.helary@...>
Not in 10.13 on my machine. Tab won't change the focus.
toggle quoted message
Show quoted text
Jean-Christophe Dec 25, 2017 8:39、Robert Poland <rpoland@...>のメール: |
|
Shane Stanley
On 25 Dec 2017, at 11:20 am, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
It will if you go to Preferences -> Keyboard -> Shortcuts and change Full Keyboard Access to All controls. But if you do so, you'll probably also find the side-effects more annoying than it's worth. -- Shane Stanley <sstanley@...> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com> |
|
Jean-Christophe Helary <jean.christophe.helary@...>
On Dec 25, 2017, at 10:13, Shane Stanley <sstanley@...> wrote:Yes, but that's not what there is in normal Mac apps, or am I wrong? I'd like to have something that acts as normal Mac dialogs. Is that possible? Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com |
|
Shane Stanley
On 25 Dec 2017, at 12:22 pm, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
"Normal" Mac dialogs don't show keyboard equivalents. -- Shane Stanley <sstanley@...> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com> |
|
Jean-Christophe Helary <jean.christophe.helary@...>
On Dec 25, 2017, at 10:56, Shane Stanley <sstanley@...> wrote:Maybe not all, but some buttons can be accessed by hitting Cmd+the first letter, or something like this. It used to be that a TextEdit dialog reacted to Cmd+D for Delete, but now it is "Change location to Desktop", etc. Anyway, normal or not, that's the kind of thing I'd like to implement. Is that possible? Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com |
|
Shane Stanley
On 25 Dec 2017, at 1:03 pm, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
display alert "Test" buttons {"Cancel", "Don't Save", "OK"}
Not in standard AppleScript, no -- you can map the buttons that respond to escape/command-. and return, but that's all. --
Shane Stanley <sstanley@...> |
|
Jean-Christophe Helary <jean.christophe.helary@...>
On Dec 25, 2017, at 11:11, Shane Stanley <sstanley@...> wrote:Ok. I'm pretty sure I've seen them in other places too, but I'm fine with your answer.Maybe not all, but some buttons can be accessed by hitting Cmd+the first letter, or something like this. It used to be that a TextEdit dialog reacted to Cmd+D for Delete, but now it is "Change location to Desktop", etc.I suspect you're thinking of "Don't Save". Alerts are hard-wired by default to map escape/command-. to Cancel, return to OK, and command-D to Don't Save: Return being the default button, right ?Anyway, normal or not, that's the kind of thing I'd like to implement. Is that possible?Not in standard AppleScript, no -- you can map the buttons that respond to escape/command-. and return, but that's all. Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com |
|
Shane Stanley
On 25 Dec 2017, at 1:34 pm, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
Those I mentioned are just the built-in defaults. Custom shortcuts can be applied to any buttons -- just not using "display dialog" or "display alert". A simple example is my Dialog Toolkit Plus library. Here's the Simple sample.scpt file that ships with it:
Return being the default button, right ? |
|
Jean-Christophe Helary <jean.christophe.helary@...>
On Dec 25, 2017, at 11:59, Shane Stanley <sstanley@...> wrote:Ok. A simple example is my Dialog Toolkit Plus library. Here's the Simple sample.scpt file that ships with it:Thank you! Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com |
|
Robert Poland
Shane,
Could you elaborate on the side-effects you are referred to? I haven’t noticed anything.
Robert Poland iMac, Late 2013, 14,2 3.2 GHz Intel Core I5, 27” 16 GB Ram, 1TB Fusion HD OS X 10.13.2 (High Sierra) |
|
Shane Stanley
On 26 Dec 2017, at 2:33 am, Robert Poland <rpoland@...> wrote:
The main thing it does is destroys the tabbing order. By default, tabbing takes you through the fields of a dialog in a left-to-right/top-to-bottom order, but in more complex dialogs developers often override this to provide a more logical flow. As soon as you turn on Full Keyboard Access, that goes out the window. And for what? In many cases tabbing highlights a control, but you still have to click on it to make it do anything. It should be useful, but it's poorly implemented. -- Shane Stanley <sstanley@...> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com> |
|
Peter Gort
Actually, once a control has focus, tapping the space bar will action that control, and once you are used to this, it means you don’t have to move your hand from the keyboard to the mouse nearly as often. I make use of this when scripting the interface, often when sending a click event to a button whose associated action creates a new window, interface scripting pauses for 5 seconds after the window is drawn, then resumes the script. However typing a space actions the control and the 5 second pause does not happen. Weird but true.
toggle quoted message
Show quoted text
Peter Gort
|
|
Jean-Christophe Helary <jean.christophe.helary@...>
On Dec 25, 2017, at 11:11, Shane Stanley <sstanley@...> wrote:I found a new one: when adding a file extension to a file, Finder asks "Add ..." and "Don't add ..." and Cmd+A triggers "Add ..." Jean-Christophe Helary ----------------------------------------------- @brandelune http://mac4translators.blogspot.com |
|