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


Click here to return to the 'A cleaner and safer alternative' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A cleaner and safer alternative
Authored by: lar3ry on Dec 01, '06 01:00:01PM
I was thinking the same thing, actually, when I first started using Tiger.

The closest command line tool that can help is Tiger's mdls command, which uses Spotlight's database.

Unfortunately, while mdls can show you that the file is an alias (kMDItemContentType = "com.apple.alias-file" or kMDItemKind = "Alias"), Spotlight's database doesn't seem to have the location where the alias points to, which seems to me to be a weakness in Spotlight.

I still have the remnants of the perl script that I started writing back then to do what this particular script does. I'm not happy having to run oascript to get the reference to an alias...

(By the way, the Spotlight attributes can be used in the shell script above to verify that the file passed to apath is indeed an alias.)

—lar3ry

[ Reply to This | # ]