• 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: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
      • From: 2551 <email@hidden>
References: 
 >AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: Jim Kessler <email@hidden>)
 >Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day? (From: Kaydell Leavitt <email@hidden>)

  • Prev by Date: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
  • Next by Date: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
  • Previous by thread: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
  • Next by thread: Re: AppleScript to erase one mounted volume if it's modification date is date is greater than one day?
  • Index(es):
    • Date
    • Thread