Shell Script for unmounting a partion/volume .. i cant get it to work!

hey im new to applesricpt.
A simple question …why does this script not work?
AppleScript says: … that there is a Syntax Error “unkknown token”???

do shell script "diskutil unmount /Volumes/OSX\ Music/" user name "ImTheAdminUser" password "thisIsMyPassword" with administrator privileges

…so i want to unmount my volume “OSX Music”!
please help

greetz
trolli

It works good thx alot Jacques!
but one problem left.
I have to unmount to volumes!

try
	do shell script "diskutil unmount /Volumes/'OSX Music'/" user name "theAdmin" password "password" with administrator privileges
	do shell script "diskutil unmount /Volumes/'Backup os2'/" user name "theAdmin" password "password" with administrator privileges
end try

I made a script Application out of that to run it automaticaly on boot.
applescript only unmount the first volume ‘OSX Music’.
I have to run, by hand, the script two times to eject both volumes.
if I split it into to seperate Script App. it makes no matter! only the first script e.g. the first volume is unmounted!
Any idears out there?

greetz
trolli

Have you tried something like this?

try
	do shell script "diskutil unmount /Volumes/'OSX Music'/; diskutil unmount /Volumes/'Backup os2'/" user name "theAdmin" password "password" with administrator privileges
end try

Thx

do shell script "diskutil unmount /Volumes/OSX\ Music/" user name "ImTheAdminUser" password "thisIsMyPassword" with administrator privileges

… but it dosent worked!
AppleScript Apllication crashed …when I try to run the script!
any other idears?
Could it be that the diskutil needs some time to run ONE command?so maybe i could INSERT an IDLE time between the two commands?
It is possible to insert idle time?

greetz

The last script you posted didin´t worked.
but it i tried the delay command with the shell script.

try
	do shell script "diskutil unmount /Volumes/'OSX Music'/" user name "Admin" password "password" with administrator privileges
	delay 2
end try
try
	do shell script "diskutil unmount /Volumes/'Backup os2'/" user name "Admin" password "password" with administrator privileges
end try

…and it works!
thx alot. I googled a long time for a soulution. The members of MacScripter are the best!
greetz to all :slight_smile:

Trolli