Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a 'parent directory' Toolbar button' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a 'parent directory' Toolbar button
Authored by: macsolve on Jul 27, '05 10:15:16AM
Or put simpler as a one-liner:

tell application "Finder" to open container of target of front window


[ Reply to This | # ]
Create a 'parent directory' Toolbar button
Authored by: cfoster on Jul 27, '05 12:07:23PM

Yep, that's pretty good. Though it does open a new window instead of changing the directory in the current window, and gives an error when we're at the root. The following exhibits the same behaviour as the original script:

    try
	tell application "Finder" to set target of front window to 
		container of target of front window
    end try

Hope this is helpful.



[ Reply to This | # ]
Create a 'parent directory' Toolbar button
Authored by: drmoomoo on Jul 28, '05 12:16:10AM

Thanks for that cleanup. Like I said in the tip, I'm new to Applescript (and writing any code in general) and spent a good half hour trying to figure out that root folder crash. That's how I ended up with so many lines. Never thought of a try statement. *sheepish grin*



[ Reply to This | # ]
Create a 'parent directory' Toolbar button
Authored by: capitalj on Jan 01, '06 09:08:10PM

Thank you cfoster, I gave your script an iTunes-like back button and put it in my tool bar.



[ Reply to This | # ]