Re: Is Image Disk Trash Empty?
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:
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