Nice. Wasn't my question, but this is the type of thing I was thinking might work for Craig.

Christopher Waterman wrote on 2022-01-11 5:52 PM:
Hey Bruce,

Here is script to encode the paths with '< >’ brackets.
*
*
*------------------------------*
*
*
tell application "BBEdit"
tell window 1
if (length of selection) = 0 then return
set _path to selection as text
set _cmd to "ruby -rURI -e "
try
set _uri to do shell script _cmd & quoted form of ("puts URI.join( \"file:///\ <file:///%5C>", URI.escape(\"" & _path & "\".chomp))")
on error
set _uri to _path
end try
set selection to "<" & _uri & ">"
#set _sel_start to (characterOffset of selection)
#set _sel_end to (length of selection) + _sel_start
#select (characters (_sel_start + 1) thru (_sel_end - 2))
end tell
end tell

——————————————————

I commented out a section that will select the path and not the brackets.


On Jan 11, 2022, at 7:29 AM, Craig Heilman <[email protected] <mailto:[email protected]>> wrote:

Follow the link by clicking anywhere in the path (delimited by the backticks) with whatever key modifiers (Cmd, Opt, etc.) have be configured and have a script grab the entire path, encode it, then follow it like a link - i.e., the same as if you Cmd-click on the following:


You could have a script do something like this; getting the path between the ticks and opening it. But you would have to invoke it through the script menu, the script palette, or a key command.

— Chris(topher)?

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://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] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/382411DC-ECA0-47E1-807B-4D52EEEB3480%40rustydogink.com <https://groups.google.com/d/msgid/bbedit/382411DC-ECA0-47E1-807B-4D52EEEB3480%40rustydogink.com?utm_medium=email&utm_source=footer>.


--
    - Bruce

_bruce__van_allen__santa_cruz__ca_

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "[email protected]" rather than posting here. 
Follow @bbedit on Twitter: <https://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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/edfe93f7-3f69-3eb8-34b3-8ad99e6fa230%40cruzio.com.

Reply via email to