Re: Out of Control Aliases?
Re: Out of Control Aliases?
- Subject: Re: Out of Control Aliases?
- From: Ron Hunsinger <email@hidden>
- Date: Mon, 12 Nov 2012 15:38:06 -0800
On Nov 12, 2012, at 1:35 PM, Luther Fuller <email@hidden> wrote:
> It's ironic, but all the alias files I'm using are hidden away where either the icon isn't seen or only a generic folder icon is presented in the Dock menu. The "Icon Preview" option is neither used nor useful here.
When you drag an item to the Dock, Dock remembers (in its preference file) an alias record pointing to the item. An alias record, unlike an alias file, is small and does not contain any icons. (An alias record is only one of the things stored in an alias file.) If Dock cannot resolve the alias without mounting any volumes, it displays a generic question-mark icon.
One might argue that Finder could do the same. A new OS could stop putting icons into alias files, and display a generic question-mark icon for any alias file that has no icon and cannot be easily resolved. The trouble is, that wouldn't be backward compatible. A common use case for alias files is that you create them on one system, and then copy them to another. (The catch phrase from the original System 7 presentation was that you could put these new-fangled aliases on a floppy disk, and "carry your desktop in your shirt pocket".) An old OS would be confused by a new alias file that was lacking its custom icon. You'd have to put an icon in the alias file, just in case, which sort of defeats the point of the exercise.
Same problem if, when creating an alias to an item whose icon was coming from somewhere inside /System, you stored a link to that icon instead of the icon itself. It wouldn't be backwards compatible. (If the icon was coming from elsewhere, the link would likely break if the alias got moved to a different system. Icons inside /System would hopefully be consistent everywhere.)
> There's something else that's odd here, too. A folder icon is generic. An alias file does not need to contain a copy of the icon. It needs to only to contain a reference to the generic icon and this icon should be stored somewhere in the system. I'm willing to bet that it IS stored in the system because the system is able to assign a generic icon to a newly created folder.
The trick is, how to display an icon for an alias file without resolving the alias. Until you resolve the alias, you don't know it's pointing to a folder.
And even if you know the target is a folder, you don't know the folder has a generic icon. It could have a custom icon, or it could be one of the special folders (Desktop, home, Documents, Library, Downloads, etc.) that has a special icon, but only if it contains a file named .localized (or, in the case of your home folder, is in its special place).
The thing is, the rules for figuring out what icon to show for a Finder item are complex, can require looking up information in many files besides the one whose icon you want to display, and only get harder the further away the item is. Doing the work once, when the alias file is created, and caching the result in the file is a good tradeoff between disk space and speed, especially when the alias file is moved far away from its target. It's true that we're trading more disk space than we used to, but disk space is also getting cheaper by the day.
-Ron Hunsinger
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden