• 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: Mount Point to Alias
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mount Point to Alias


  • Subject: Re: Mount Point to Alias
  • From: Luther Fuller <email@hidden>
  • Date: Wed, 12 Aug 2009 19:59:21 -0500

I case there is any doubt about what works, here's the handler I'm now using ...

on mountImageDisk(imageFileAlias)
-- imageFileAlias is an alias to a disk image file (.dmg, .sparseimage, .sparsebundle)
tell application "Finder" to open imageFileAlias
set posixPath to (POSIX path of imageFileAlias)
if last character of posixPath is "/" then set posixPath to (text 1 thru -2 of posixPath)
repeat -- while Finder mounts the disk
try
delay 1
set imageInfo to (do shell script "hdiutil info")
set AppleScript's text item delimiters to {posixPath}
set imageInfo to (text item 3 of imageInfo)
set AppleScript's text item delimiters to {"/dev"}
set imageInfo to (text item 2 of imageInfo)
set AppleScript's text item delimiters to {tab & "/Volumes"}
set volName to ("/Volumes" & (text item 2 of imageInfo))
exit repeat
end try
end repeat
(POSIX file volName) as alias
return the result -- an alias to the disk mounted from the disk image file
end mountImageDisk

Perhaps there should be a few error messages in there somewhere. Later.

 _______________________________________________
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

References: 
 >Mount Point to Alias (From: Luther Fuller <email@hidden>)
 >Re: Mount Point to Alias (From: Luther Fuller <email@hidden>)
 >Re: Mount Point to Alias (From: Peter Baxter <email@hidden>)
 >Re: Mount Point to Alias (From: Peter Baxter <email@hidden>)
 >Re: Mount Point to Alias (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: SOLVED: Getting Plain-Text onto the Clipboard
  • Next by Date: Re: Using \U \L in regular expressions
  • Previous by thread: Re: Mount Point to Alias
  • Next by thread: Re: Mount Point to Alias
  • Index(es):
    • Date
    • Thread