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: 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