short-cut 'Notes' window

144 views
Skip to first unread message

Peter Schoo

unread,
Nov 23, 2023, 7:21:30 AM11/23/23
to BBEdit Talk
Using BBedit 14.6, I like a lot the notes windows allowing me to take notes and manage them i.e. my half-down work in an efficient way. The 'Notes' window plays a central role.

However, sometimes I experience the situation that, while in another application or on MosOS, I'd like to switch instantly into the 'Notes' window to add or continue on existing notes.

Any idea how to create a keyboard shortcut or similar that allows me to bring this 'Notes' window in front and focus?

GP

unread,
Nov 23, 2023, 2:54:13 PM11/23/23
to BBEdit Talk
While it might not be exactly what you want, the "New Note in BBEdit" service might satisfy your needs.

In system Settings -> Keyboard -> Keyboard Shortcuts ... -> Services -> Text you can assign a keyboard shortcut to the "New Note in BBEdit" entry.  In order for that service to become active where you want to use it you'll need to select a bit of text. Once you've assigned the keyboard shortcut to the service item, you can verify the assignment by selecting a bit of text then under the application menu select Services and look at the keyboard shortcut associated with the  "New Note in BBEdit" item in the Services menu items list.

Peter Schoo

unread,
Nov 23, 2023, 5:40:15 PM11/23/23
to BBEdit Talk
Thank you GP for answering. The shortcut for "New Note in BBEdit" with selected text is certainly useful, but it is not what I am looking for.

I search for a way to go to the 'Notes' window from random places, i.e. any other app or the OS, by keyboard command only.

Bruce Van Allen

unread,
Nov 23, 2023, 6:19:25 PM11/23/23
to bbe...@googlegroups.com
Look again at setting up services.

> Thank you GP for answering. The shortcut for "New Note in BBEdit" with selected text is certainly useful, but it is not what I am looking for.

I’m re-stating GP’s suggestion to make sure you get that this wasn’t about assigning a keyboard shortcut in BBEdit to use while running BBEdit.

Here's what I did just now that I think gets what you want:

In Services Settings, I made sure the main heading “Text" is checked. Clicking its down arrow to show text services, I made sure “New Note in BBEdit” is checked.

Simply taking those steps now provides New Note in BBEdit in the Services menu of any* application - ** provided that I have some text selected in the front-running application whose Services menu I’ve invoked. If I choose New Note in BBEdit, it grabs the selected text and opens a BBEdit note with that text.

Now, back in Services Settings, when confirming that New Note in BBEdit is checked, I can also see whether a keyboard combination has been assigned to it. I can double-click at the right side of the service to add a keyboard combo if necessary.

Now, in any cooperating* application, if I have some text selected, by keyboard or mouse-dragging, I can hit that keyboard command and the selected text opens in a BBEdit note.

*Not all Mac apps cooperate - I couldn’t get this to work in Apple News, which didn’t seem to recognize that an article’s text was selected, so wouldn’t reveal the text-related Services options.

HTH

— 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 "sup...@barebones.com" 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 bbedit+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/45e811cc-d967-4dc7-9a43-7860d4d93446n%40googlegroups.com.


jj

unread,
Nov 24, 2023, 3:24:12 AM11/24/23
to BBEdit Talk
Hi Peter,

 1. Activate the system AppleScript Menu in the menubar
      • Launch the Script Editor at Applications/Utilities/Script Editor.app
      • In Script Editor's settings, check the 'Show Script menu in menu bar' checkbox
      • Now you should have a permanent new Script menu on the right of your  menubar
      • In this Script menu, choose 'Open Scripts Folder' > 'Open User Scripts Folder'
      
Screenshot 2023-11-24 at 08.53.22.png

2. Copy this AppleScript into the folder that was just opened, naming the script 'Open BBEdit Notes.applescript'

use AppleScript version "2.8"

use scripting additions

tell application "System Events" to tell process "BBEdit"

   set frontmost to true

   click menu item "Notes" of first menu of menu bar item "Window" of first menu bar

end tell


3. The menu item 'Open BBEdit Notes' should now appear somewhere in the menubar Script menu.

Now on, you will be able to open the BBEdit's Notes window from everywhere.

HTH

Jean Jourdain

Peter Schoo

unread,
Nov 24, 2023, 4:51:22 AM11/24/23
to BBEdit Talk
Jean, yes for sure AppleScript is an answer and it works fine with your script. (When AppleScript has not been used before, configure in privacy&security settings that the script-menu is allowed to exec commands.) 

Many thanks for this solution. Very much appreciated.

GP

unread,
Nov 24, 2023, 6:58:03 AM11/24/23
to BBEdit Talk
Provided the only "Notes" bundle you're using is the BBEdit created default Notes.bbnotebookd stored in ~/Library/Application Support/BBEdit/Notes.bbnotebookd and you're using a version of Mac OS supporting the Shortcuts app, I think I've found a solution that completely meets the solution you're looking for. 

Using the Shortcuts app, create a new shortcut using the "Open File" shortcut found in the Files subgroup in the Documents category. The shortcut starts out as "Open File in Default.app". Double click on "File" to get a file chooser dialog. Navigate to and choose ~/Library/Application Support/BBEdit/Notes.bbnotebookd. Then double click on "Default.app" to get an app chooser. Find BBEdit and choose it.

Once that's done and after test running it to ensure it is working then on the sidebar's toolbar click on the "info" icon. Check that "Use as Quick Action" and "Service Menu" items are checked. Then click on the "Add Keyboard Shortcut" button and it will change to "Run With:" with a text box where you add the keyboard shortcut you want to use to invoke the shortcut.

Lastly, under the file menu choose Rename... and rename the shortcut to name/title as you want to see appear as the menu item title in the Services menu.

In my limited testing, the shortcut will if needed launch BBEdit, open the Notes bundle/window if not already open, bring the Notes window to the front. IF BBEdit and the Notes bundle/window are already open then the shortcut will bring BBEdit and the Notes window to the front with the previously selected note from the Notes list and cursor position retained from the last visit.

Reply all
Reply to author
Forward
0 new messages