Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
- Subject: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
- From: "koenig.yvan" <email@hidden>
- Date: Fri, 21 Jun 2013 10:10:08 +0200
Le 20/06/2013 à 23:52, Kaydell Leavitt <email@hidden> a écrit :
> Jim,
>
> Here is a script that solves part of the problem.
>
> This AppleScript uses the shell command "diskutil" to erase a whole volume.
>
> It seems to work, I tested it on a disk image that I created with the "Disk Utility.app" application that comes with OS X.
>
> -- Kaydell
>
> -- This script is an example of how to erase an entire volume quickly in AppleScript by calling
> -- the shell command "diskutil"
>
> tell application "Finder"
> launch
> set temporaryDrive to "TemporaryDrive"
> display dialog "Warning!!! This script will erase the volume called " & temporaryDrive & " are you sure that you want to do this?"
> do shell script "/usr/sbin/diskutil eraseVolume HFS+ " & temporaryDrive & " /Volumes/" & temporaryDrive with administrator privileges
> end tell
>
> Let me know what you think. email@hidden
>
> -- Kaydell
What need for the tell application "Finder" … end tell wrapper ?
My understanding is that
set temporaryDrive to "TemporaryDrive"
display dialog "Warning!!! This script will erase the volume called " & temporaryDrive & " are you sure that you want to do this?"
do shell script "/usr/sbin/diskutil eraseVolume HFS+ " & temporaryDrive & " /Volumes/" & temporaryDrive with administrator privileges
would be sufficient.
KOENIG Yvan (VALLAURIS, France) vendredi 21 juin 2013 10:09:56
_______________________________________________
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