How to check if volume is mounted??

Hi Everyone-

I have the following script:

set folder_ to "folder name"  
set volume_ to "volume name"
 mount volume volume_
 tell application "Finder" 
    open alias folder_ 
 end tell

I need to add an ‘if’ statement to check if the volume is already mounted. Because, if the volume is already mounted, applescript ,rightfully so, returns and error and quits.

How can I do this?

Can this be done in a try statement? And if so and the program returns an error due to the volume already being mounted, will the rest of the program continue?


You can do this two ways (both shown below). The second is preferable, I think, because it should be quicker.