I would to choose a file/an image that is being mounted in the Terminal

set pathelection to POSIX path of (choose file of type {"sparsebundle", "sparseimage", "dmg"})

do shell script "hdiutil mount" & " " & pathelection

  • Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. – user3439894 Jun 7 '15 at 10:00
  • Is this part of a larger script? The reason I'm asking is you can just simply double-click an image file in Finder and it's going to mount automatically, so no need to script it by itself. – user3439894 Jun 7 '15 at 10:14
  • I'd assume so. Based on the syntax he used, it's also possible he's just in the process of learning, since some of it is peculiar. – William T Froggard Jun 7 '15 at 10:38

Well, I have no clue what you want, but your code isn't guaranteed to work, which may be your problem. Try this:

set image to POSIX path of (choose file of type {"sparsebundle", "sparseimage", "dmg", "cdr", "iso"})
do shell script "hdiutil mount " & quoted form of image

Source: Part-time work as a prophet

  • Make that a prophet of satan. This post got my rep to 666. – William T Froggard Jun 7 '15 at 13:02
  • lol I had that once :) let's change it since another kind soul did it for me, just for that. – user128544 Jun 7 '15 at 14:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .