Jump to content

script for unmounting volume


Jocke Bohlin
 Share

7 posts in this topic

Recommended Posts

Hello

 

I want to unmount my network volume "Backup-disc" with an applescript. I´m running OS9.2 Why does not this work:

 

tell application "Finder"

if disk "Backup-disc" exists then

eject "Backup-disc"

end tell

 

The result is syntaxerror "Expected "Else" but found "End Tell"."

 

//Jocke

Link to comment
Share on other sites

The eject command refers to CD's in mac OS 9, I think.

 

Instead, try this script:

 

tell application "Finder"

if disk "Backup-disc" exists then

move disk "Backup-disc" to trash

end if

end tell

 

It ejects the volume, but finder prompts you whether you want to eject it or not.

I just tested this script on my good old iMac G3, under mac OS 9 and it works. :(

 

The help for script editor was better in 8.5 or 8.6, as far as I remember..

Link to comment
Share on other sites

Unfortunately, you can't GUI script, so the if/then scenario works out the best

 

Do you have a better thing to eject volumes? I would really like to do it without the finder prompt. :)

Link to comment
Share on other sites

Ok, thank you. I haven't been using applescript for a while, and've forgotten quite a lot. Not unrecoverable, anyway :)

Link to comment
Share on other sites

 Share

×
×
  • Create New...