Re: File links/URLs within BBEdit documents

2022-01-15 Thread Christopher Stone
> On Jan 12, 2022, at 11:50, jj wrote: > An easy way to get the URI of a document from the finder on macOS Monterey: This is easy enough to automate... -Chris # Auth: Christopher Stone # dCre: 2022/01/15 18:42 # dMod: 2022/01/15 18:42

Re: File links/URLs within BBEdit documents

2022-01-11 Thread Christopher Waterman
Craig, I remembered I have a script I use for checking if the cursor is in a string, and realized it would be easy to change it for your needs. At least as I understand them. Here is a script that will follow a path that is in between back-ticks. It will open the file or folder according to

Re: File links/URLs within BBEdit documents

2022-01-11 Thread Christopher Waterman
*Sigh* I’m not smart. That was meant for Craig. > > Nice. Wasn't my question, but this is the type of thing I was thinking might > work for Craig. — Chris(topher)? -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email

Re: File links/URLs within BBEdit documents

2022-01-11 Thread Bruce Van Allen
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

Re: File links/URLs within BBEdit documents

2022-01-11 Thread Christopher Waterman
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 "

Re: File links/URLs within BBEdit documents

2022-01-11 Thread Craig Heilman
Hi Chris, This script looks promising. How would you add the enclosing “<“ and “>” to make the file URI into a clickable markdown link? I’ll take a look at the user manual for Attachment Scripts. I suppose I could try looking at this from another angle - i.e., do the processing when trying to

Re: File links/URLs within BBEdit documents

2022-01-11 Thread Craig Heilman
The path may include spaces which need to be encoded (e.g., “%20”) so it’s not quite that simple… Craig > On Jan 10, 2022, at 10:06 PM, 'Jeffrey Jones' via BBEdit Talk > wrote: > > On 2022 Jan 10, at 18:45, Craig Heilman > wrote: >> >> Bringing this back to

Re: File links/URLs within BBEdit documents

2022-01-11 Thread Craig Heilman
Well my preferred steps for any type of file would be just drag and drop, using one or more modifier keys as required, and the magic of generating the full “>” and inserting in the BBEdit document would happen under the hood… Craig > On Jan 10, 2022, at 10:25 PM, Bruce Van Allen wrote: > >

Re: File links/URLs within BBEdit documents

2022-01-11 Thread 'Jeffrey Jones' via BBEdit Talk
On 2022 Jan 10, at 18:45, Craig Heilman wrote: > > Bringing this back to BBEdit - is there anything in BBEdit that can simplify > this process? I like the idea of starting with the path because that doesn’t > lock me into any of the Finder/Finder replacements but how to make this as > close

Re: File links/URLs within BBEdit documents

2022-01-10 Thread Christopher Waterman
Craig, If you drag and drop a text file on to an open bbedit doc it will insert the contents at the cursor. But if you hold the cmd key it will insert and select a path. You could then run a script to encode it. Here is an example that works for me but I haven’t tested much. Install it into

Re: File links/URLs within BBEdit documents

2022-01-10 Thread Bruce Van Allen
Craig Heilman wrote on 2022-01-10 7:44 PM: > Hmm, on my system (BBEdit 14.0.4 under Monterey 12.1) the little > document icon is in the upper *right* Sorry, my bad - mine's on the right, too. For non-BBEdit files, what would be your preferred steps? E.g., select the file in the Finder, and

Re: File links/URLs within BBEdit documents

2022-01-10 Thread Craig Heilman
Hi Chris, Yes, the ‘Open URL’ command is what I have been using but I bypass the contextual menu by simply Cmd-clicking anywhere in the URL. Good to know about the Edit -> Copy Path -> Copy URL command and the info panel so there’s lots of ways to get a file URL of the current BBEdit document

Re: File links/URLs within BBEdit documents

2022-01-10 Thread Craig Heilman
Hi Bruce, Hmm, on my system (BBEdit 14.0.4 under Monterey 12.1) the little document icon is in the upper right of the BBEdit window but I found it eventually. Yes, that’s helpful knowing there’s a way to get a file URL (“location”) directly. I see that Cmd-I is another way to get to that

Re: File links/URLs within BBEdit documents

2022-01-10 Thread Christopher Waterman
Craig, So you are want to open urls to files and folders from an open document in bbedit? Assuming I got that right, there is an 'Open URL' contextual menu. Just right (ctrl) click on a url and have at it. There is also Edit > Copy Path > Copy URL to get an escaped version of the open file’s

Re: File links/URLs within BBEdit documents

2022-01-10 Thread Bruce Van Allen
Hi Craig, If you click the little document icon upper left in the BBEdit window, you'll see that it provides a "Location" link, with a button to copy it to the clipboard. That handles the encoding. Only works on a file saved to disk, obvs :) I haven't looked, but that might also be

File links/URLs within BBEdit documents

2022-01-10 Thread Craig Heilman
In my local note files (text but with .md file extension), I often include links to other files using the file URL scheme (“”) as I can then easily navigate to those files by simply Cmd-clicking anywhere in the URL. For several years I’ve been using Path Finder as a Finder replacement and it