2

I would like to create shortcuts to "zoom" my Finder window text size.

I have tried in AppleScript

tell application "Finder"
    if text size of list view options of front window = 10 then
        set text size of list view options of front window to 16
    else
        set text size of list view options of front window to 10
    end if
end tell

which works but I cannot see the change until I "refresh" the window by closing and re-opening it.

I tried adding

update items of front window

but this does nothing.

Any way to do this elegantly?

I'm on El Capitan.

2
  • What Apple OS version are you using? Also, please edit your post to include enough of the code to easily reproduce, so as to test with what you actually have, which is certainly more then what you've posted since the first line that you did post contains an uninitialized variable as provided. Sep 16, 2016 at 13:44
  • The last version of OS X that worked in by itself was OS X 10.8 and since OS X 10.9 it has been an issue. The only other option I can think of would be a UI type approach where you brought up the View Options floating window and manipulated it there. That said, I'd opt for programmatically closing and reopening the target window. Sep 16, 2016 at 18:01

1 Answer 1

1

Ze'ev, amigo:

This sounds like a job for the shell, and we might get you the functionality you desire in possibly two ways.

First, let's try the elegant method: Without closing any windows, send a SIGHUP to the Finder process, shell-side, after you change that parameter in the AppleScript. Specifically, add the line:

do shell script "pkill -1 -l Finder"

The second argument to pkill -- the '-l' -- is for debugging purposes. If this works, remove the '-l'.

On a side-note, the font size change is also something that can be changed from the shell-side, via the 'defaults' command.

Please let me know if that works out for you.

Best of luck,

F.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .