• 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: Delete a hidden file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delete a hidden file


  • Subject: Re: Delete a hidden file
  • From: Luther Fuller <email@hidden>
  • Date: Mon, 01 Nov 2010 11:31:19 -0500

On Nov 1, 2010, at 11:01 AM, Jason Lantz wrote:

I asked this question before, but was unable to make any of the suggestions work.   I think I need provide more detailed information, so I am trying again.

Objectives: 
1. To delete a specific hidden file
2. For the script to work on any machine (aka absent of hard coded file paths)
3. To delete the file without requiring the user to directly choose or select the file

I had a couple of unused invisible files lying around doing nothing, so I tried this ...

set appSupAlias to (path to application support from user domain)
tell application "Finder"
try
set fileAlias to (file ".9000143.plist" of appSupAlias) as alias -- error here if it does not exist
delete fileAlias -- trashes the file if it does exist
end try
end tell

It seems to work correctly. One problem ... deleting with the Finder puts the file in the Trash. You might want to delete with System Events which simply makes the file disappear.


 _______________________________________________
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

References: 
 >Delete a hidden file (From: Jason Lantz <email@hidden>)

  • Prev by Date: Re: Window watcher
  • Next by Date: Re: How Do I Get the html Source for a Web Page into a String?
  • Previous by thread: RE: Delete a hidden file
  • Next by thread: Re: Delete a hidden file
  • Index(es):
    • Date
    • Thread