AppleScript choose file with Terminal action 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" &amp; " " &amp; pathelection
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 " &amp; quoted form of image


Source: Part-time work as a prophet