I have seen the error, but never took the time to look into it and deal
with it. For whatever reason, the Find dialog doesn't have the
characterOffset variable defined nor does it understand the select
command. As a workaround, you can replace the below line with the chunk of
code below it. It works for both the move and select script. It simply
tries to do what it did before and if it runs into problems, it will simply
activate the up-arrow key, which will move the text cursor to the start of
the text field, which is generally what you want. It works for the select
version of the script if your keyboard shortcut uses the shift key. I wish
I could come up with a more elegant solution, but there it is. I may
update what I have on my site later, but this is a simple replacement for
you to get you on your way. It doesn't seem to work in the Save dialog.
I'd suggest just using your up-arrow in that case.
--tell line _n to set {_linestart, _line} to {characterOffset, contents}
try
tell line _n to set {_linestart, _line} to {characterOffset,
contents}
on error
-- For dialogs that don't have a characterOffset
tell application "System Events"
-- Up arrow, which should move cursor to start of line
key code 126
end tell
return
end try
-Kendall
On Monday, July 2, 2018 at 2:30:29 AM UTC-4, Jon B. wrote:
>
> I am using the Smart Home and Smart Home Select scripts, via
>
>
> http://www.angelwatt.com/words/2010/07/31/bbedit-textwrangler-home-key-behavior/
>
> I set Smart Home to ⌘←. If I use this key in BBEdit's Find Window, I get
> an error message.
>
> What's the best way to have that key perform normally if not in the BBEdit
> text edit window?
>
> Thank you.
>
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" 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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.