Is there any way to write a script to check that a certain volume is mounted (named ‘Storage’) before allowing an application to open?
For example, I have all my music for iTunes in my Storage volume, and I want to make it so that I cannot open iTunes without mounting that volume first.
Is this possible? Easy? Hard? Commit Suicide?
Thanks.
Model: MacBook
Browser: Firefox 2.0.0.1
Operating System: Mac OS X (10.4)
Okay, and because I’m completely new to applescript, how do I make it so that everytime I try and open iTunes, it will look at the script first (i.e. only open when the Storage volume is attached/mounted).
save the script as application, put it in the dock, and start it instead of iTunes.
If you assign the icon of iTunes to the script, you will see no difference
And if you don’t know how to get the iTunes icon to the script application, you copy the iTunes icon from the top left of the Get Info window for iTunes, and paste it over the script icon in the Get Info for your script application which you might call “iTune”. You could have set this up to mount the volume, too, but you didn’t ask for that.
You could also make it a little more user-friendly.
tell application "System Events"
if exists disk "Storage" then
activate application "iTunes"
else
display dialog "Mount the Storage drive and try again!" buttons "OK" default button "OK" giving up after 10
end if
end tell
Model: G5 Tower (not Intel) - Script Editor ver 2.1.1
AppleScript: Tiger
Browser: Safari 419.3
Operating System: Mac OS X (10.4)