• 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: Thu, 13 Aug 2009 16:06:33 -0500

The handler I previously posted has a problem that should be corrected.
Here's the corrected handler ...

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 imageInfo to (text item 2 of imageInfo)
set AppleScript's text item delimiters to {return}
set volName to ("/Volumes" & (text item 1 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 -----------------------------------------

 _______________________________________________
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>)

  • Prev by Date: Re: opening PowerPoint presentation without bringing to front?
  • Next by Date: Re: Using \U \L in regular expressions
  • Previous by thread: Re: Mount Point to Alias
  • Next by thread: Do Script Illustrator CS3
  • Index(es):
    • Date
    • Thread