On 07/02/2018, at 01:30, Jon B. <nyc2...@gmail.com <mailto:nyc2...@gmail.com>> 
wrote:
> I set Smart Home to ⌘←. If I use this key in BBEdit's Find Window, I get an 
> error message.


Hey Jon,

In general it's a bad idea to hijack normal system-key functionality.

It tends to be too be impossible to manage all the possible exceptions.

Like:

The Find window.
The Find field in an editing window.
Text fields in dialog boxes.
Etcetera.

Usually it's better to select a similar keystroke like Opt-Cmd-<Left-Arrow>.

> What's the best way to have that key perform normally if not in the BBEdit 
> text edit window?


As I mentioned there's no good way to manage all the possible exceptions, but 
many things are possible with Keyboard Maestro 
<https://www.keyboardmaestro.com/main/>.

You can use System Events to press keystrokes, so you can do something like 
this:


tell application "BBEdit"
    set windowExceptionList to {find_window}
    if class of front window is in windowExceptionList then
        pressKey() of me
    else
        # Run Smart Home Script ...
    end if
end tell

on pressKey()
    tell application "System Events"
        tell application process "BBEdit"
            key code 123 using command down
        end tell
    end tell
end pressKey


But once again that won't manage various text fields in windows and dialogs.

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to