Hi Lutz,

Check the BBEdit manual (it's a PDF that downloads so you get the latest), starting at page 337 "Filters and Scripts". That section explains how BBEdit helps us by providing a set of environment variables to scripts that are launched from within BBEdit.

    Document State
For convenience, BBEdit sets some runtime environment variables to provide information about the front document’s state right before a Unix filter or script is run: ...

Among those environment variables are - yay! - BB_DOC_NAME and BB_DOC_PATH.

So here's a quick Perl script that you could start from. This opens the front-most file in Safari - I don't have BlueGriffon. I saved this as ~/Library/Application Support/BBEdit/Scripts/get_BBEdit_Doc_test.pl

#!/usr/bin/perl

use strict;
use warnings;

exec qx(open -a Safari $ENV{BB_DOC_PATH});


A shell script would also get those environment variables. So you could put this in a file in the same BBEdit Scripts folder:

#!/bin/bash
open $BB_DOC_PATH -a BlueGriffon


Then just assign a keyboard combination to the script.


On 5/12/19 at 12:47 AM, [email protected] (Lutz Pietschker) wrote:

Hi Bruce, thanks for the hint. I have no idea how to get the path to the file except through AppleScript, so this is what I came up with:
tell application "BBEdit" to set theDoc to file of document 1
set thePOSIXPath to (the POSIX path of theDoc)
set theCommand to "open '" & thePOSIXPath & "' -a BlueGriffon"
do shell script theCommand

It is slow, but it works. Thanks again!
Lutz

Am Samstag, 11. Mai 2019 22:12:24 UTC+2 schrieb Bruce Van Allen:

Hi Lutz,
Try a simple shell script or Perl script that opens the html file in BlueGriffin, saved to your BBEdit scripts folder, with an assigned key combination. Reply to this list if this would be foreign territory for you; some experienced guides inhabit this space (but I didn't want to presume you'd need that).

--

  - 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 to the group.
Follow @bbedit on Twitter: <https://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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/r480Ps-10144i-90CEB91F74604025AA97CAB23AC1A44F%40Forest.local.

Reply via email to