#!/bin/zsh -f

# Put full path in finder

version="0.0.1"


###############################################################################
 
#  Created by  on 2007-11-17.
#  Copyright (c) 2007. All rights reserved.


#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
#    USA
#    
#    cf. URL:   http://www.fsf.org/licensing/licenses/gpl.html
#
###############################################################################

if [[ $(sw_vers -productVersion) < 10.5 ]]; then
	print "Works on 10.5.X and above only."
	return 10
else
	print "Adds the full path in the Finder title bar"
	print "To remove, issue \e[1m $0 NO \e[0m "
fi

if [[ $1 == NO || $1 == no || $1 == No ]]; then
    defaults write com.apple.finder _FXShowPosixPathInTitle -bool NO
	osascript -e 'tell app "Finder" to quit'
	sleep 2
	open -a Finder
else
	defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
	osascript -e 'tell app "Finder" to quit'
	sleep 2
	open -a Finder
fi

 
