An Automator workflow set as a Quick Action could work. Quick Actions are available when right-clicking a file in the Finder, among other ways.
In Automator start with “Files & Folders” -> “Get Selected Finder Items”, then add “Utilities” -> “Run Applescript”.
In the script pane that opens for Run Applescript, paste this after "on run {input, parameters}”:
tell application “Finder"
activate
set strFilePath to {}
tell application “Finder"
repeat with objItem in (get selection)
set end of strFilePath to POSIX path of (objItem as text)
end repeat
end tell
tell application “BBEdit"
activate
--open filePath opening in front_window
open strFilePath opening in new_window
end tell
end tell
Save this Automator Workflow Quick Action with a name you’ll recognize.
Now, when you right-click a file in the finder, the pop-up will have this script listed under “Quick Actions”.
Note the commented line "--open filePath opening in front_window". One suggestion would be make two of the quick actions, one using “front_window” and the other using “new_window” (there’s also “separate_windows”), naming them accordingly. Then they’ll both be available as quick actions that work regardless of BBEdit’s preference.
Also note that this little script uses a klunky way to get the path of the selected file into the right form to hand to BBEdit, but it was the only one I could get to work. Maybe some of this list’s scripting adepts can point out a better way.
HTH
— Bruce
_bruce__van_allen__santa_cruz_ca_
> To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/db8a262a-3c1b-403a-96a8-724bf2c8c09fn%40googlegroups.com.