So when I set this scenario up it works the way you want. Meaning the doc 
that was opened is selected in the left pane.
But, you can manipulate what file is selected.
I'm making at least one assumption. 

1. This isn't a project style window where you have two panes in the left 
column. One labeled Project the other labeled "Current Open Documents". 
Like when you make a .bbprojectd file of open a folder in BBEdit.  It IS a 
window with a left column marked "Currently Open Documents"

Select doesn't work on files or file paths.

Select does work on "items" of "project window" (all windows with documents 
are project windows).

Take a look at your window with:
tell application "BBEdit"
   get documents of project window 1
end

You should get an output like: "{*text document* 1, *project document* 
"untitled project}"
So, "text document 1" is the most recently opened item.

Try this.

tell application "BBEdit"
activate

tell application "Finder" to set theFile to "Macintosh 
HD:Users:johnlove:Sites:www.lovetoteach.dev:Web_Site_Storage:
lovesongforever.com:coronavirus:Coronavirus_Support/Compiled_Output_scss=
css:compiled_corona_virus.html"

open file theFile  -- select file theFile bombs with an error

end tell






On Friday, April 10, 2020 at 8:01:08 PM UTC-7, John Love wrote:
>
> Using an external Script, I am trying to select a pre-named BBEdit file in 
> the left Pane, so that the selected file opens in the right Pane. 
>
> Here is my small Script module:
>
> tell application "BBEdit"
> activate
>
> tell application "Finder" to set theFile to "Macintosh 
> HD:Users:johnlove:Sites:www.lovetoteach.dev:Web_Site_Storage:
> lovesongforever.com
> :coronavirus:Coronavirus_Support/Compiled_Output_scss=css:compiled_corona_virus.html"
>
> open file theFile  -- select file theFile bombs with an error
>
> end tell
>
>
>
> It opens the file and shows it in your right Pane, but does not select it 
> in your left Pane.
>
> FWIW, I can go the choose File approach, but I still don't get the 
> selection in the left Pane.
>
> ASAMOF, what I’d really like to do is to use
>
> select file theFile
>
>
> but as noted, this bombs with an error.
>
> John Love
>
>

-- 
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/ed755c23-cf51-4243-a3e5-97b976a1eee4%40googlegroups.com.

Reply via email to