Re: Open a path in a text file

2021-03-19 Thread @lbutlr
On 17 Mar 2021, at 17:06, Christopher Stone  wrote:
> This script will pop up a dialog giving you the choice of opening the file or 
> folder of the path selected in the front BBEdit window.  All keyboard – no 
> mouse needed.

Thank you, that is exactly what I wanted

-- 
NOTHING IS FINAL. NOTHING IS ABSOLUTE. EXCEPT ME, OF COURSE. SUCH
TINKERING WITH DESTINY COULD MEAN THE DOWNFALL OF THE WORLD.
THERE MUST BE A CHANCE, HOWEVER SMALL. THE LAWYERS OF FATE DEMAND
A LOOPHOLE IN EVERY PROPHECY. --Sourcery

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/64A7BD6B-685B-4EE3-BA8D-29A7586DFF89%40kreme.com.


Re: Open a path in a text file

2021-03-17 Thread Christopher Stone
On 03/13/2021, at 17:47, @lbutlr mailto:krem...@kreme.com>> 
wrote:
> So, I have a text file that has a path to a file, and I would like to open 
> that file, or the directory containing that file.


Hey Lewis,

This script will pop up a dialog giving you the choice of opening the file or 
folder of the path selected in the front BBEdit window.  All keyboard – no 
mouse needed.

--
Best Regards,
Chris


# Auth: Christopher Stone mailto:scriptmeis...@thestoneforge.com>>
# dCre: 2021/03/17 18:02
# dMod: 2021/03/17 18:03
# Appl: BBEdit, Finder
# Task: Open a File or its Parent Folder by a Path Selected in the Front Window.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @Finder, @Open, @File, @Folder, @Path

property LF : linefeed
property openStatusList : {"File", "Folder"}


tell application "BBEdit"
set pathStr to selection's contents
set pathStr to replace "\\A\\s+|\\s+\\Z" searchingString pathStr using "" 
options {search mode:grep}
end tell

set itemAlias to alias POSIX file pathStr

set openStatus to choose from list openStatusList ¬
with title "Open File or Folder" with prompt ¬
"Pleae Make Your Choice:" default items {"File"} ¬
without empty selection allowed

if openStatus ≠ false then

set {openStatus} to openStatus

tell application "Finder"
if openStatus = "File" then
open itemAlias
else if openStatus = "Folder" then
activate
open parent of itemAlias
end if
end tell
end if



-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/D9F8B066-7D9A-41F5-960C-0049348B0583%40gmail.com.


Re: Open a path in a text file

2021-03-14 Thread Sam Hathaway

On 13 Mar 2021, at 18:47, @lbutlr wrote:

The "Open" service works, but it pops up a "Bbedit wants to use the 
restricted service 'open'" every single time, which is almost, but not 
quite, as annoying as the cope/paste.


I made this automator action that, as far as I can tell, does the same 
thing as the built in “Open” service, but doesn’t trigger the 
confirmation prompt.


![](cid:19373296-163E-4A37-B371-95B9F73293B9@munkynet.org 
"PastedImage.png")


Hope this helps!
-sam

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: 
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/53C24A65-3AE5-4EFB-881C-026F3131C306%40munkynet.org.


Re: Open a path in a text file

2021-03-14 Thread jj
* copy it to ~/Library/Application\ Support/BBEdit/Scripts

On Sunday, March 14, 2021 at 2:27:00 PM UTC+1 jj wrote:

> @lbutlr,
>
> Here is an AppleScript that might solve your problem :
>
> https://gist.github.com/mixio/7e3a909d391b30853c3cc39efb68d51a
>
> Copy it somewhere in ~/Library/Library/Application\ Support/BBEdit/Scripts.
>
> After relaunching BBEdit, you will be able to use it from the Script Menu 
> in BBEdit and set a keyboard shortcut to it in Window > Palettes > Scripts.
>
> Let me know if that worked for you.
>
> Best regards,
>
> Jean Jourdain
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/e1d8a054-6238-48a7-9703-61f6e44c7691n%40googlegroups.com.


Re: Open a path in a text file

2021-03-14 Thread jj
@lbutlr,

Here is an AppleScript that might solve your problem :

https://gist.github.com/mixio/7e3a909d391b30853c3cc39efb68d51a

Copy it somewhere in ~/Library/Library/Application\ Support/BBEdit/Scripts.

After relaunching BBEdit, you will be able to use it from the Script Menu 
in BBEdit and set a keyboard shortcut to it in Window > Palettes > Scripts.

Let me know if that worked for you.

Best regards,

Jean Jourdain

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/4aaf0aa9-1c5a-4ee5-a95e-a1473956fd7an%40googlegroups.com.


Re: Open a path in a text file

2021-03-14 Thread @lbutlr
On 14 Mar 2021, at 01:33, Tom Robinson  wrote:
> If I’m following you:
> 
> 1. in any macOS Open dialog, you can type a / and a special input field will 
> appear where you can type/paste a path (to a directory, not a file)

Sure, but I am in BBEdit in a file with many file paths. I want to open a file 
from that text file.

> 2. in BBEdit there’s an Open File by Name command, where you can type/paste 
> in a path to a file.

And that is still copying and pasting the text as opposed to, for example, 
rclicking on a selected line and choosing "service -> Open" which brings up 
that restricted service dialog and doesn't save the "open enclosing folder" 
behavior that I also want.

NB: the file may not be (probably is not) a file that BBEdit can open, it is 
just a file where I have the path in a text file.

-- 
The quality of our thoughts and ideas can only be as good as the
quality of our language.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/7677911E-6DE1-4376-866F-3D4C8EB87F64%40kreme.com.


Re: Open a path in a text file

2021-03-14 Thread Tom Robinson
If I’m following you:

1. in any macOS Open dialog, you can type a / and a special input field will 
appear where you can type/paste a path (to a directory, not a file)

2. in BBEdit there’s an Open File by Name command, where you can type/paste in 
a path to a file.

Cheers


> On 2021-03-14, at 12:47, @lbutlr  wrote:
> 
> Greetings and happy Coviversary:
> 
> So, I have a text file that has a path to a file, and I would like to open 
> that file, or the directory containing that file.
> 
> Currently, I copy the path manually, then paste it into the terminal (or a 
> shell worksheet in BBEdit), and prepend 
> 
> open "
> 
> And append
> 
> "
> 
> (I can skip the quotes if there are no spaces, of course)
> 
> And hit return.
> 
> The "Open" service works, but it pops up a "Bbedit wants to use the 
> restricted service 'open'" every single time, which is almost, but not quite, 
> as annoying as the cope/paste.
> 
> The "Open in BBEdit is fine if the file needs to be opened in BBEdit itself, 
> but neither open nor open in BBEdit has an option to open the enclosing 
> folder, so I have to be careful about the selection instead of just the 
> entire line, and then since I do not want to open the PATH in BBEdit, I have 
> to jump through the restricted dialog.
> 
> It occurs to me there must be a better way to do this? I thought of 
> automator, but rejected that since there is no flow-control for deciding if 
> to grab the directory or the full path, but I suppose I cold do two services?
> 
> Before I spend a lot of time noodling, any suggestions?

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/9E3C4DB9-1536-40D9-B732-59B88FC06CEC%40gmail.com.