Salut,
J'ai trouvé ce code qui me permet d'éjecter/monter mon disque dur interne de mon hackintosh (PC qui fait tourner macOS) Il marche parfaitement bien, mais j'aimerais qu'il éjecte un DEUXIEME disque dur. Pour l'instant il ne peut éjecter que le DD "Windows HD". J'aimerai qu'il éjecte également un disque dur d'un autre nom. Comment faire ?
Merci pour votre aide
set diskName to "Windows HD"
tell current application
set deviceLine to (do shell script "diskutil list | grep \"" & diskName & "\" | awk '{ print substr($0,69,9) }'")
if deviceLine = "" then
display dialog "The disk \"" & diskName & "\" cannot be found." buttons {"OK"} default button 1 with title "Error" with icon caution
end if
set foundDisks to paragraphs of deviceLine
end tell
tell application "Finder"
if disk diskName exists then
tell current application
repeat with i from 1 to number of items in foundDisks
set this_item to item i of foundDisks
if this_item contains "disk" then
do shell script "diskutil eject /dev/" & this_item
end if
end repeat
end tell
else
tell current application
repeat with i from 1 to number of items in foundDisks
set this_item to item i of foundDisks
if this_item contains "disk" then
do shell script "diskutil mountDisk /dev/" & this_item
end if
end repeat
end tell
end if
end tell