• 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: Is Image Disk Trash Empty?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is Image Disk Trash Empty?


  • Subject: Re: Is Image Disk Trash Empty?
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 25 Jan 2011 17:07:13 -0600

I got around the permissions problem with this handler ...

on TrashIsEmpty(diskAlias)
set AppleScript's text item delimiters to {return}
set uid to do shell script "id -u"
quoted form of (POSIX path of ((diskAlias as text) & ".Trashes:" & uid & ":"))
do shell script "ls " & the result
return ((count text items of the result) = 0)
end TrashIsEmpty ---------------------------------------

It seems to work correctly. There is one problem ... it only tests for the current user's trash. If other users, with a different user id, have trashed anything, it's not detected. I think this will work for my purposes, so I think I will stop while I'm ahead.

 _______________________________________________
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: 
 >Is Image Disk Trash Empty? (From: Luther Fuller <email@hidden>)
 >Re: Is Image Disk Trash Empty? (From: Luther Fuller <email@hidden>)
 >Re: Is Image Disk Trash Empty? (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: 'my' problem is your problem: it chokes without 'my'! BUG
  • Next by Date: Re: Is Image Disk Trash Empty?
  • Previous by thread: Re: Is Image Disk Trash Empty?
  • Next by thread: Re: Is Image Disk Trash Empty?
  • Index(es):
    • Date
    • Thread