Increase/decrease font size keyboard shortcut

669 views
Skip to first unread message

John Siracusa

unread,
Jun 20, 2008, 4:47:03 PM6/20/08
to bbe...@googlegroups.com
Is there any way to bind a keyboard shortcut to increase/decrease font
size? I suppose I could invoke the font picker, then use AppleScript
+ UI scripting to fiddle with its controls, but that seems like a bit
much. Any easier way?

(Just FYI, my usage scenario is when someone needs to look over my
shoulder at some code or something. I use 9pt Monaco, which is way
too small for someone farther away to see, so it'd be convenient to be
able to just hit cmd +/- (or whatever) to quickly enlarge the text in
any given window.)

-John

Jim Correia

unread,
Jun 20, 2008, 4:59:28 PM6/20/08
to bbe...@googlegroups.com
On Jun 20, 2008, at 4:47 PM, John Siracusa wrote:

> Is there any way to bind a keyboard shortcut to increase/decrease font
> size? I suppose I could invoke the font picker, then use AppleScript
> + UI scripting to fiddle with its controls, but that seems like a bit
> much. Any easier way?

A pair of AppleScripts which manipulate the font size directly?

tell application "BBEdit"
tell text window 1
set fs to display font size
set display font size to fs + 1
end tell
end tell

Jim

Dennis

unread,
Jun 20, 2008, 5:43:10 PM6/20/08
to BBEdit Talk
I could have sworn BBEdit shipped with a pair of scripts that did
exactly that. I don't know, the scripts have been sitting in my BBEdit
scripts folder for so long (close to a decade?), I don't know where
they came from. They're very similar to Jim's example:


tell application "BBEdit"
set dfs to display font size of text window 1
set dfs to dfs + 1
set display font size of text window 1 to dfs
end tell


tell application "BBEdit"
set dfs to display font size of text window 1
if dfs > 4 then
set dfs to dfs - 1
set display font size of text window 1 to dfs
else
beep
end if
end tell


-Dennis

John Siracusa

unread,
Jun 25, 2008, 3:38:30 PM6/25/08
to bbe...@googlegroups.com
These worked like a charm, thanks Jim and Dennis.

-John

Harold Tessmann III

unread,
Jun 26, 2008, 12:20:07 AM6/26/08
to bbe...@googlegroups.com
John Siracusa <sira...@gmail.com> typed something resembling:

I know this doesn't directly answer your question, but you may find it
a useful alternative. Have you considered turning on Zoom in the
Universal Access control panel? If you get it set up right, you can
use Control + scroll wheel on your mouse to zoom in. And I do mean
_if_. I have it working on my Mac running Tiger, but not on my Mac
running Leopard, and I don't exactly know why.

Harold

Rod Buchanan

unread,
Jun 26, 2008, 9:40:16 AM6/26/08
to bbe...@googlegroups.com
On Jun 25, 2008, at 11:20 PM, Harold Tessmann III wrote:

> John Siracusa <sira...@gmail.com> typed something resembling:
>
>> Is there any way to bind a keyboard shortcut to increase/decrease
>> font
>> size? I suppose I could invoke the font picker, then use AppleScript
>> + UI scripting to fiddle with its controls, but that seems like a bit
>> much. Any easier way?
>

> I know this doesn't directly answer your question, but you may find it
> a useful alternative. Have you considered turning on Zoom in the
> Universal Access control panel? If you get it set up right, you can
> use Control + scroll wheel on your mouse to zoom in. And I do mean
> _if_. I have it working on my Mac running Tiger, but not on my Mac
> running Leopard, and I don't exactly know why.

FWIW, that works on my Leopard install w/o turning anything on in
Universal Access.

--
Rod

"Only one human captain has ever survived battle with a Minbari fleet.
He is behind me. You are in front of me. If you value your lives, be
somewhere else."
-- Delenn to Captain Drake in Babylon 5: "Severed Dreams"

Reply all
Reply to author
Forward
0 new messages