How to erase a CD-RW via AppleScript?
How to erase a CD-RW via AppleScript?
- Subject: How to erase a CD-RW via AppleScript?
- From: Jason Alexander <email@hidden>
- Date: Mon, 24 Feb 2003 18:36:35 +0000
Hello,
Is it possible to erase a CD-RW using AppleScript? (I ask because I'm
trying to write a Konfabulator widget which allows me erase a CD with a
single click.) I've found a couple of things which suggest it may be
possible, but none of them work quite right.
Method 1: Wrap the command "hdiutil burn -erase" in an AppleScript.
This doesn't work because:
(a) hdiutil first spits out the CD and then erases the next CD inserted.
(b) hdiutil doesn't leave the CD in a useable condition recognized by
the Finder.
Method 2: Use diskutil.
This doesn't work because:
(a) diskutil (for this purpose) can only be invoked by root.
(b) the command "sudo diskutil eraseOptical quick /dev/disk2" doesn't
work on my machine, even though /dev/disk2 is a CD, as the following
illustrates:
bash-2.05a$ df -l
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/disk0s5 39066000 35076872 3598472 90% /
fdesc 2 2 0 100% /dev
/dev/disk2 1372160 18992 1353168 1% /Volumes/untitled CD
bash-2.05a$ sudo diskutil eraseOptical quick /dev/disk2
Password:
Device disk2 does not appear to be an optical device
Disk Utility Tool !Z2002, Apple Computer, Inc.
Usage: diskutil eraseOptical [quick]
[Mount Point|Disk Identifier|Device Node]
Completely erase an existing optical disk. Root access is required.
Example: diskutil eraseOptical quick /dev/disk2
Any help would be greatly appreciated.
Cheers,
Jason
--
J. McKenzie Alexander
Department of Philosophy, Logic and Scientific Method
London School of Economics and Political Science
Houghton Street, London WC2A 2AE
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.