![]() ![]() If you want automatic revealing:ĭefaults write 14.0 and later feature built-in support for the Language Server Protocol, Cribbing from the Expert Preferences help:īBEdit will not automatically reveal documents in the project list when you select them View => Reveal in Project List works for this purpose. There is an expert preference which controls this behavior. (The selection in the "Currently Open Documents" section always does.) In addition: if you are working in a project document, the selection in the "Projects" section does not automatically change to reflect the active document. Set openedDocument to (open POSIX file "/path/to/some/file.txt") - substitute your actual file path here This (or something like it) will do what you want: tell app "BBEdit" The "select" verb is not appropriate for use on files it will only work on "document" objects. The "open" command refers a reference to the document just opened. ![]() (Whether you're using a hardcoded path, or not, is irrelevant, as long as the file you're asking BBEdit to open actually exists.) If the file isn't already open, BBEdit will open it and then select it. If the file is already open, BBEdit will select it. SO, to do that, the programmer must invoke Terminal with: setAutoRevealSelectedDocumentInProjectList() HOWEVER, this does not change the Project file selected on top. If you develop an AppleScript that opens a file via the open(name) command, BBEdit will open it and show it highlighted at the bottom under "Currently Open Documents". Rich patiently teaches us that the leftmost Pane of BBEdit's window, consists of two separate parts: 1) the Project's files on topĢ) Currently Open Documents at the bottom Keystroke "defaults write AutoRevealSelectedDocumentInProjectList -bool YES "Įnd setAutoRevealSelectedDocumentInProjectList until they sedate me!" on setAutoRevealSelectedDocumentInProjectList() Rich is the author of the Pearl of Wisdom "Someday I will look back on all of this and laugh. Tell application "Finder" to set theFile to "Macintosh HD:Users:johnlove:Sites:select theFileĪnd BBEdit did open it and show the opened theFile in the right-most Pane, but without selecting this file in the left-most Project Pane. Select : the object to selectįor what it's worth, I have tried this Script within Apple's Script Editor: tell application "BBEdit" I have definitely looked at BBEdit's AppleScript Dictionary which reads: select v : Select the specified object I get this error: error "BBEdit got an error: \"compiled_corona_virus.html\" doesn’t understand the “select” message." number -1708 from "compiled_corona_virus.html" Set theFile to "compiled_corona_virus.html" I have tried the following and it doesn't work. The challenge right now is to use AppleScript for #1. select "Preview in BBEdit" under its "Markup" Menu.select a specific file in this Pane and then.When I open BBEdit, without AppleScript, my Project opens up, with the Project file list in the left Pane just like it should. ![]() How do I use Applescript to select a specific file in the Project Pane of a BBEdit window? ![]()
0 Comments
Leave a Reply. |