Show/Hide Toolbars

how to write a conditional that detects wheather a Finder window is in showing toolbar mode and if it is set it to hide the toolbars and vice versa

I’m talking about the result you get with option/command-T (View->Hide/Show Toolbar)



try this

tell application “Finder”
– activate
if the (count of windows) is not 0 then
set myWindows to Finder windows
repeat with myPane in myWindows
if toolbar visible of myPane is true then
set toolbar visible of myPane to false
set toolbar visible of myPane to true
end if
end repeat
end if
end tell

It’s much easier if you want all windows the same way.

tell application “Finder”
if the (count of windows) is not 0 then
set toolbar visible of windows to false
end if
end tell

Best wishes

John M

You have to be careful in the Finder as there are different types of windows. In your first example, you get it right (“Finder windows”), in the second example, you say windows not “Finder windows”. Also, using a simple try, you can get it down to just:

Again, for more control over your Finder windows, check out my application Finder Window Manager.


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

is it poissible to give window distinctive names (as a variable I guess) so whatever I’m trying to do affects only the windows I have specified as targets for a particualr operation and leave all other Finder windows I had opened unaffacted?