• 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: Wed, 26 Jan 2011 08:30:49 -0600

On Jan 25, 2011, at 5:40 PM, Christopher Stone wrote:

File Buddy will also find it with ease, but you have to enable admin-access.

But, I need something that will work entirely within AppleScript.

Then I fired up the Terminal:

sudo find /Volumes/Hammer/.Trashes/ -type f
sudo ls -lR /Volumes/Hammer/.Trashes/

I think you can use administrator privileges in a 'do shell script' to automate that:

 A: Use the administrator privileges, user name and password parameters like this:

http://developer.apple.com/library/mac/#technotes/tn2002/tn2065.html

I had already experimented with using 'sudo', but it adds more overhead than I want.

I used do shell script "id -u" to get around the permissions problem with do shell script "ls " & ... 
I wondered if this would also work with the Finder. It does and my final handler is ...

on TrashIsEmpty(diskAlias)
do shell script "id -u"
(diskAlias as text) & ".Trashes:" & the result & ":"
tell application "Finder" to count items of item the result
return (the result = 0)
end TrashIsEmpty ---------------------------------------

I think this is as close as I can get.

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

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