Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I - show sidebar in finder with applescript?

Hi all,


I am looking for a way using applescript in OS X El Capitan 10.11 to "show sidebar" on the frontmost finder window.


When I try to record the finder window and choose menu > "show sidebar" it records what's below - but this does not work when played back.


tell application "Finder"

activate

set width of column id name column of list view options of Finder window 1 to 522

set width of column id name column of list view options of Finder window 1 to 320

end tell



also this line no longer works


set sidebar width of window 1 to 50


Q: So how do I get applescript to "show sidebar" ?



Thanks - Dave

MacBook Pro, OS X El Capitan (10.11.3)

Posted on Apr 27, 2016 8:24 AM

Reply
Question marked as Best reply

Posted on Apr 27, 2016 12:38 PM

It seems the sidebar can never be less than 110 pixels wide, even if you try to set its width to 100.

So, to show sidebar:

tell application "Finder"

tell window 1

set sidebar width to 100

end tell

end tell

3 replies

Apr 27, 2016 3:13 PM in response to Pierre L.

Thanks Pierre,


Your code worked - thanks!


question - when I tried it this way - it shows error...


select Finder window 1 rather than TELL block...


why is that?



tell application "Finder"

activate

select Finder window 1

set current view of Finder window 1 to list view

-- do other stuff

set sidebar width to 100

tell window 1

--set sidebar width to 100

end tell

end tell

Apr 27, 2016 3:31 PM in response to revDAVE

You can use

tell application "Finder"

set sidebar width of Finder window 1 to 100

end tell

or

tell application "Finder"

tell Finder window 1

set sidebar width to 100

end tell

end tell

However, you cannot use:

tell application "Finder"

selectFinder window 1

set sidebar width to 100

end tell

because sidebar width is a property of Finder window 1, not a property of the Finder.

How do I - show sidebar in finder with applescript?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.