Re: Inscrutable DiskCopy
Re: Inscrutable DiskCopy
- Subject: Re: Inscrutable DiskCopy
- From: "Marc K. Myers" <email@hidden>
- Date: Tue, 30 Oct 2001 15:56:21 -0500
- Organization: [very little]
>
From: Brennan <email@hidden>
>
Date: Tue, 30 Oct 2001 02:55:47 +0100
>
To: applescript-users <email@hidden>
>
Subject: Inscrutable DiskCopy
>
>
I'm trying to make a script to convert a folder to a self-mounting-image, and
>
am having real trouble.
I found this script in my files that seems to do exactly what you're
looking for:
on run
open ({choose folder})
end run
on open (itemList)
set anItem to item 1 of itemList as alias
set deskPath to (path to desktop) as text
set {od, AppleScript's text item delimiters} to ,
{AppleScript's text item delimiters, {":"}}
if (anItem as text) ends with ":" then
set itemName to text item -2 of (anItem as text)
else
display dialog "This only works with folders!" buttons {"OK"} default
button 1 with icon stop
error number -128
end if
if (count of itemName) > 27 then
set itemName to text 1 thru 27 of itemName
end if
set AppleScript's text item delimiters to od
set imgPath to deskPath & itemName & ".img"
tell application "Disk Copy"
save (anItem as alias) in disk image (file imgPath) ,
using format NDIF Compressed with zeroing without image signing and
leave image mounted
create SMI file (deskPath & itemName & ".smi") source images {file imgPath}
quit
end tell
tell application "Finder" to delete alias imgPath
end open
Watch out for line wraps and remember that "[optn-L]" stands in for the
real AppleScript continuation character.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[10/30/01 3:54:04 PM]