• 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
Phantom Alias File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Phantom Alias File


  • Subject: Phantom Alias File
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 16 May 2006 17:15:07 -0500

I have used the following handler in scripts for a long time without any problem. I recently posted it to this list in answer to a question. Today, after a couple of hours work, I found a problem with a phanton alias file that won't delete properly.

on remove(itemAlias) -- deletes a file without putting it in the Trash
	try
		"rm -fr " & (quoted form of POSIX path of itemAlias)
		do shell script the result
	on error errText number errNr
		error "(at remove)" & return & errText number errNr
	end try
end remove

I am working on an AppleScripted application where I wanted to remove an unwanted alias file. After running the application to remove the alias file, I ran it again only to find a dialog containing information, such as the name of the original item of the alias file, that only the alias file knows. I can run the application as many times as I like, but it continues with this behavior. The alias file is still there.

If I open the folder containing the alias file, I can see it for a fraction of a second before it disappears. I can now run my application and get correct results. The alias file is finally removed.

The only work-around I could find was to replace 'my remove (itemAlias)' with 'delete itemAlias'. It works, but has the undesirable side-effect of having a file mysteriously appear in the trash.

I don't know what's causing this problem, but I wondering if 'rm' has trouble with Macintosh alias files. Does anyone know more?

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: URL Access Scripting
  • Next by Date: Re: URL Access Scripting
  • Previous by thread: Re: Odd Finder duplication error
  • Next by thread: image loading
  • Index(es):
    • Date
    • Thread