• 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: Auto mount .dmg in High Sierra? Possible??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Auto mount .dmg in High Sierra? Possible??


  • Subject: Re: Auto mount .dmg in High Sierra? Possible??
  • From: Brian Christmas <email@hidden>
  • Date: Sat, 24 Mar 2018 10:15:28 +1100

G’day

Would have helped if I'd used -format and not commented out the relevant line.

However, this routine is far more versatile, but it turns out I need to unmount
the drive before trying to compress it. I cannot get the format correct though,
for….

set shellScriptTwo to (("hdiutil unmount " as text) & myPath)

—> hdiutil: unmount: "/Users/OzSanta/Documents/My XCode Projects/AA Sierra
Public/Web Site stuff/Art Archiver.dmg" failed to unmount due to error 16.
hdiutil: unmount failed - Resource busy


tell application "System Events" to set myFile to choose file of type {"dmg"}
with prompt "Please select a disk image to set the 'auto open' on :"
set myPath to quoted form of POSIX path of myFile

tell application "Finder" to set myName to (name of myFile) as text
tell application "System Events" to display dialog myName giving up after 2


set myNameTwo to quoted form of ((characters 1 thru ((offset of "." in myName)
- 1) of myName) as text)
tell application "System Events" to display dialog myNameTwo giving up after 2

set shellScript to "hdiutil attach -verify -autofsck -mount required " & myPath

do shell script shellScript

-->  "hdiutil attach -noverify -noautofsck -mount required
'/Users/OzSanta/Documents/My XCode Projects/AA Sierra Public/Web Site stuff/Art
Archiver.dmg'"

set shellScriptTwo to (("hdiutil unmount " as text) & myPath)

do shell script shellScriptTwo

tell application "System Events" to set myFolder to choose folder with prompt
"If desired, please select a new folder in which to save a compressed version
of the disk image, or Cancel :"
set folderPath to quoted form of POSIX path of ((myFolder as text) & myName)

set shellScriptThree to "hdiutil convert " & myPath & " -format UDZO -o " &
folderPath

do shell script shellScriptThree

-->hdiutil convert '/Users/OzSanta/Documents/My XCode Projects/AA Sierra
Public/Web Site stuff/Art Archiver.dmg' UDZO -o '/Users/OzSanta/Desktop/Art
Archiver.dmg.zip'"

shellScript & return & return & shellScriptThree

Any advice please??

Regards

Santa


>
> set myFile to choose file of type {"dmg"} with prompt "Please select a disk
> image to set the 'auto open' on :" #of type {".dmg"}
> set myPath to quoted form of POSIX path of myFile
> tell application "Finder" to set myname to name of myFile as text
> set shellScript to "hdiutil attach -verify -autofsck -mount required " &
> myPath
>
> do shell script shellScript
>
> -->  "hdiutil attach -noverify -noautofsck -mount required
> '/Users/OzSanta/Documents/My XCode Projects/AA Sierra Public/Web Site
> stuff/Art Archiver.dmg'"
> set myFolder to choose folder with prompt "If desired, please select a new
> folder in which to save a compressed version of the disk image, or Cancel :"
> set folderPath to quoted form of POSIX path of ((myFolder as text) & myname &
> ".zip")
>
> set shellScript2 to "hdiutil convert " & myPath & " UDZO -o " & folderPath
> #do shell script shellScript2
>
> -->hdiutil convert '/Users/OzSanta/Documents/My XCode Projects/AA Sierra
> Public/Web Site stuff/Art Archiver.dmg' UDZO -o '/Users/OzSanta/Desktop/Art
> Archiver.dmg.zip'"
>
> shellScript & return & shellScript2
> (*
> UDRW - UDIF read/write image
> UDRO - UDIF read-only image
> UDCO - UDIF ADC-compressed image
> UDZO - UDIF zlib-compressed image
> ULFO - UDIF lzfse-compressed image (OS X 10.11+ only)
> UDBZ - UDIF bzip2-compressed image (Mac OS X 10.4+ only)
> UDTO - DVD/CD-R master for export
> UDSP - SPARSE (grows with content)
> UDSB - SPARSEBUNDLE (grows with content; bundle-backed)
> UFBI - UDIF entire image with MD5 checksum
>       UDRo - UDIF read-only (obsolete format)
>       UDCo - UDIF compressed (obsolete format)
>       RdWr - NDIF read/write image (deprecated)
>       Rdxx - NDIF read-only image (Disk Copy 6.3.3 format;
>                       deprecated)
>       ROCo - NDIF compressed image (deprecated)
>       Rken - NDIF compressed (obsolete format)
>       DC42 - Disk Copy 4.2 image (obsolete format)
>
> *)

 _______________________________________________
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: Auto mount .dmg in High Sierra? Possible??
      • From: Paul Scott <email@hidden>
References: 
 >Auto mount .dmg in High Sierra? Possible?? (From: Brian Christmas <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Paul Scott <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Brian Christmas <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Paul Scott <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: "Stockly, Ed" <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Brian Christmas <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Paul Scott <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Brian Christmas <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Paul Scott <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Brian Christmas <email@hidden>)
 >Re: Auto mount .dmg in High Sierra? Possible?? (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Auto mount .dmg in High Sierra? Possible??
  • Next by Date: Re: Auto mount .dmg in High Sierra? Possible??
  • Previous by thread: Re: Auto mount .dmg in High Sierra? Possible??
  • Next by thread: Re: Auto mount .dmg in High Sierra? Possible??
  • Index(es):
    • Date
    • Thread