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
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/
On Dec 24, 2017, at 12:50 AM, Jean-Christophe Helary <jean.christophe.helary@...> wrote: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
Fort Collins, CO
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
-----------------------------------------------
@brandelune http://mac4translators.blogspot.com
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
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/On Dec 24, 2017, at 12:50 AM, Jean-Christophe Helary <jean.christophe.helary@...> wrote:Robert Poland
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
Fort Collins, CO
-----------------------------------------------
@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.
It appears that NOW you can use the Tab key to select which button you want then hit return to activate it.
Jean-Christophe
On Dec 24, 2017, at 7:57 AM, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
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-ChristopheDec 24, 2017 22:58、Robert Poland <rpoland@...>のメール:
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/On Dec 24, 2017, at 12:50 AM, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
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
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"
On Dec 24, 2017, at 2:57 PM, Jean-Christophe Helary <jean.christophe.helary@...> wrote:Dec 25, 2017 2:40、Robert Poland <rpoland@...>のメール:
It appears that NOW you can use the Tab key to select which button you want then hit return to activate it.
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-ChristopheOn Dec 24, 2017, at 7:57 AM, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
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-ChristopheDec 24, 2017 22:58、Robert Poland <rpoland@...>のメール:
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/On Dec 24, 2017, at 12:50 AM, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
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
Fort Collins, CO
Fort Collins, CO
Jean-Christophe Helary <jean.christophe.helary@...>
Not in 10.13 on my machine. Tab won't change the focus.
Jean-Christophe
toggle quoted message
Show quoted text
Jean-Christophe
Dec 25, 2017 8:39、Robert Poland <rpoland@...>のメール:
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"On Dec 24, 2017, at 2:57 PM, Jean-Christophe Helary <jean.christophe.helary@...> wrote: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.
It appears that NOW you can use the Tab key to select which button you want then hit return to activate it.
Jean-Christophe
Shane Stanley
On 25 Dec 2017, at 11:20 am, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
--
Shane Stanley <sstanley@...>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
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.
Tab won't change the focus.
--
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?
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.
Tab won't change the focus.
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:
--
Shane Stanley <sstanley@...>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
"Normal" Mac dialogs don't show keyboard equivalents.
I'd like to have something that acts as normal Mac dialogs.
--
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.
On 25 Dec 2017, at 12:22 pm, Jean-Christophe Helary <jean.christophe.helary@...> wrote:"Normal" Mac dialogs don't show keyboard equivalents.
I'd like to have something that acts as normal Mac dialogs.
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:
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:
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.
display alert "Test" buttons {"Cancel", "Don't Save", "OK"}
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.
--
Shane Stanley <sstanley@...>
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:
display alert "Test" buttons {"Cancel", "Don't Save", "OK"}
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".
Yes.
I'm pretty sure I've seen them in other places too
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:
use AppleScript version "2.4" -- Yosemite (10.10) or lateruse scripting additionsuse script "Dialog Toolkit Plus" version "1.0"set accViewWidth to 650set {theButtons, minWidth} to create buttons {"Cancel", "Five", "Four", "Three", "Two", "One", "OK"} button keys {"", "5", "4", "3", "2", "1", ""} cancel button 1 default button 7if minWidth > accViewWidth then set accViewWidth to minWidth -- make sure buttons fitset {theField, theTop} to create field "" placeholder text "Enter your text here" bottom 0 field width accViewWidth extra height 60 with accepts linebreak and tabset {boldLabel, theTop} to create label "How many buttons would you like? There's no real limit except for practical and aesthetic considerations." & return & "Of course, I hope you'll never really think about using something as ugly as this!" & return & return & "Choose your heart out!" & return & return & "Also, try the command-1 thru command-5 button shortcuts." bottom theTop + 20 max width accViewWidth control size regular sizeset {buttonName, controlsResults} to display enhanced window "Many Buttons" acc view width accViewWidth acc view height theTop acc view controls {theField, boldLabel} button list theButtons active field theField initial position {0, 0} with align cancel button
Return being the default button, right ?
Jean-Christophe Helary <jean.christophe.helary@...>
On Dec 25, 2017, at 11:59, Shane Stanley <sstanley@...> wrote:Ok.
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".
I'm pretty sure I've seen them in other places too
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.
On Dec 24, 2017, at 6:13 PM, Shane Stanley <sstanley@...> wrote:On 25 Dec 2017, at 11:20 am, Jean-Christophe Helary <jean.christophe.helary@...> wrote:
Tab won't change the focus.
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>
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)
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:
It should be useful, but it's poorly implemented.
--
Shane Stanley <sstanley@...>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
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.
Could you elaborate on the side-effects you are referred to?
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
On 26 Dec 2017, at 9:20 am, Shane Stanley <sstanley@...> wrote:In many cases tabbing highlights a control, but you still have to click on it to make it do anything.
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 ..."
On 25 Dec 2017, at 1:03 pm, Jean-Christophe Helary <jean.christophe.helary@...> wrote: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:
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.
display alert "Test" buttons {"Cancel", "Don't Save", "OK"}
Jean-Christophe Helary
-----------------------------------------------
@brandelune http://mac4translators.blogspot.com