tell application "Finder"
set CFDisk to disk "My CF Disk Name"
delete items of CFDisk
empty trash -- Danger Will Robinson!
eject CFDisk
end tellThis too is a little unsafe, since it will empty the trash (for all disks) without asking confirmation. Here's one that does:tell application "Finder"
set itemsInTrash to (number of items of trash)
set CFDisk to disk "My CF Disk Name"
if (itemsInTrash > 0) then
(* Undocumented subtlety here: we get OK and Cancel by default,
and hitting cancel aborts the script *)
display dialog (itemsInTrash as string) & " items already in trash will be erased. Proceed?"
end if
delete items of CFDisk
empty trash
eject CFDisk
end tellI've tested the above scripts, but offer no warrantee.You are not logged in, either login or create an account to post comments
posted by mkb at 9:59 AM on October 26, 2009