Global Keyboard Shortcut for BBEdit Scratchpad?

255 views
Skip to first unread message

Brian Christiansen

unread,
Sep 1, 2017, 11:44:00 AM9/1/17
to BBEdit Talk
Hello,

I use the scratchpad all day long… I compose messages for pretty much anything there first, before pasting them into email, Slack, Basecamp, web forms, whatever. I would love a universal keyboard shortcut that could be triggered from any app or the Finder that would bring me the Scratchpad instantly. 

I thought I might be able to create one in Sys Prefs > Keyboard > Shortcuts, but I struck out. I experimented with LaunchBar's ability to trigger services, and there is an "Append to BBEdit Scratchpad" service, but unfortunately, it takes its service very literally… it'll append the selection, but it won't make the Scratchpad visible.

Does anyone have something to do this currently? Thanks!

P.S.—this message was written on the Scratchpad.

Fletcher Sandbeck

unread,
Sep 1, 2017, 12:09:10 PM9/1/17
to bbe...@googlegroups.com
You can do this with an Automator Service and the global Keyboard Shortcuts system preferences. Check out the Stack Exchange article below.

https://apple.stackexchange.com/questions/175215/how-do-i-assign-a-keyboard-shortcut-to-an-applescript-i-wrote

Open Automator and create a new Service. Set the input to No Input. Add a Run AppleScript action with this AppleScript.

tell application "BBEdit"
activate
open scratchpad document
set the index of the window of scratchpad document to 1
end tell

Save that as as "Scratchpad.workflow" or something similar.

Now, go into System Preferences and open Keyboard and the Shortcuts tab. Select Services and scroll down to General. Your new service should be listed there. Assign it a keyboard shortcut. I assigned it to Command-` and it does seem to work.

[fletcher]
> --
> This is the BBEdit Talk public discussion group. If you have a
> feature request or would like to report a problem, please email
> "sup...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: <http://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 bbedit+un...@googlegroups.com.
> To post to this group, send email to bbe...@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.

Brian Christiansen

unread,
Sep 6, 2017, 10:06:20 AM9/6/17
to BBEdit Talk
This worked brilliantly, Fletcher. I wouldn't have thought to create a service to accomplish this. Thanks so much for taking the time to write out the script.

Best,
~brian
Reply all
Reply to author
Forward
0 new messages