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


Click here to return to the 'YA modified version' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
YA modified version
Authored by: caesurae on May 27, '06 01:13:18PM
I also liked the hint and created my own version which i believe is less complex than others' scripts (definitely less verbose).

The entire solution exists as a bash script which calls osascript for a one-liner AppleScript statement for each argument given and then activates Finder. If no directory/path is given, then it looks in the current working directory. Otherwise, paths can be relative to ~ (home) or / (root), and can include spaces as long as "quotes" are used.

I usually make aliases (tcsh) to my scripts, in this case i chose... alias rev ~/bin/revealInFinder.bash. So to use the script, I simply type something like;

rev file1 ~/folder/file2 "/folder x/folder y/file 3" etc.

I don't want to chance posting the script in this web forum environment due to some very specific quoting schemes used to allow files/paths with spaces. Instead, you can click here to download it.

I have considerably less experience in shell scripting than with AppleScript, so if any shell gurus out there have some more efficient and/or robust syntax, I'd love to see it. However, I do believe the script to be fairly reliable, and #comments are included so you can see the how and why of the methods i have chosen.

Thanks again to Lutin for the submission.

[ Reply to This | # ]