• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Alias Files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alias Files


  • Subject: Re: Alias Files
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 12 Sep 2007 16:54:02 -0500

On Sep 12, 2007, at 4:07 PM, Doug McNutt wrote:

At 12:21 -0500 9/12/07, Luther Fuller wrote:
I ran into a problem late yesterday. I'll spare you all the gory details and offer this problem instead ...

A folder contains two files exactly, one of the files is an alias file
pointing to the other file. Write a script that will remove ONLY
the alias file from this folder.


If the alias file was created by Mac OS X, then the problem is easy to solve. Ask the Finder for a list of the contents of the folder, then find and delete the item whose 'class of item ...' is 'alias file'.

But, what if the alias file is a symlink? (The folders I'm actually dealing with are from an ISO 9660 CD)
I'm thinking that it can't be done.

I'm not quite sure what "exactly" means here. You really can't have two files with the exact same name in a single folder.

I should have said "exactly two".

But watch for suppressed extensions as practised by Finder. Even if you have Finder set to display extensions it NEVER displays a .app extension. That can make two files, an APPL and an alias to it appear to have the same name but deep down in the system, one of them really has a .app extension. If you "remove" it with a shell rm command you'll have to add the extension while you would have no extension on the symlink.

In this case, the files DO have different names and extensions are not a problem. Let's keep the problem simple!


If the files show different names and "exactly" just means there are only two files the symlink will show itself with a ls -F command or, probably, with a Finder GetInfo command. In icon view OS 10.3.9 shows a little arrow on symlinks as well as on alias files. I donno about 10.4 and I'm not ready to drop my SE/30 file server so I can use it.

My experience is that in a list of file references, Mac 'Alias Files' are not resolved to their original item, but symlinks are automatically resolved to their original item. Perhaps a solution to my problem would be to get the list of files using a 'do shell script'. But, I'm not sure what the proper command might be.


_______________________________________________
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
  • Follow-Ups:
    • Re: Alias Files
      • From: Emmanuel <email@hidden>
    • Re: Alias Files
      • From: Doug McNutt <email@hidden>
References: 
 >Alias Files (From: Luther Fuller <email@hidden>)
 >Re: Alias Files (From: Doug McNutt <email@hidden>)

  • Prev by Date: Re: Alias Files
  • Next by Date: Re: AppleScript-Users Digest, Vol 4, Issue 443
  • Previous by thread: Re: Alias Files
  • Next by thread: Re: Alias Files
  • Index(es):
    • Date
    • Thread