CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Liste des sujets

Aidez moi à compléter ce code svp :(

banpseudoban
banpseudoban
Niveau 9
11 octobre 2016 à 21:09:04

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
Sous forums
  • Aide à l'achat Mac
  • Steam Deck
  • Création de sites web
  • Création de Jeux
  • Linux
  • Programmation
  • Internet
  • Macintosh
  • Hardware
La vidéo du moment