Externe Festplatte mounten per Script?

macsparky

Mitglied
Thread Starter
Dabei seit
16.01.2006
Beiträge
24
Reaktionspunkte
0
Hallo,
ich habe hier lange gesucht, ob jemand ein Script hat, mit dem ich meine externe USB/Firewire Festplatte mounten kann. Leider ohne Ergebnis...

Zur Zeit nehme ich dazu immer das Festplattendienstprogamm, aber ich hätte gerne ein Script dazu.

Per Terminal bin ich bisher gescheitert, vielleicht hat jemand einen Tipp?
mount /Volumes/M9\ MINI\ POD/ oder auch
mount "/Volumes/M9 MINI POD/" funktioniert auch nicht....

Danke!!!
 
Ciao,
das folgende Script hatte ich mal geschrieben, um meine 5 externen Platten zu verwalten; sollte auch in Deinem Fall funktionieren. Hab' jetzt leider keine Zeit, das Script zu kommentieren aber wenn's interessiert können wir es ein andermal hier im Forum untersuchen.
PHP:
property diskInfoList : {}
global theID

tell application "Finder"
	set mountedDisks to name of every disk
end tell

set diskInfoList to {}
set chooseList to {}
set theDisks to (do shell script "diskutil list")
set c to count of paragraphs of theDisks
repeat with i from 1 to c
	if word 2 of paragraph i of theDisks = "Apple_HFS" then
		set end of diskInfoList to {nameDisk:(word 3 of paragraph i of theDisks), deviceName:(last word of paragraph i of theDisks)}
		set end of chooseList to (word 3 of paragraph i of theDisks)
	end if
end repeat
set choice to (choose from list chooseList with prompt "Scegli il disco da dis/attivare:") as string

searchID(choice)

mountUNmount(choice, theID, mountedDisks)

on searchID(choice)
	repeat with i from 1 to count of diskInfoList
		if (nameDisk of item i of diskInfoList) = choice then
			set theID to (deviceName of item i of diskInfoList)
			exit repeat
		end if
	end repeat
	return theID
end searchID

on mountUNmount(choice, theID, mountedDisks)
	if choice is not in mountedDisks then
		display dialog "Vuoi attivare il disco \"" & choice & "\" ?" buttons {"Annulla", "OK"} default button 2 with icon 1
		if button returned of the result = "OK" then
			set theCommand to "diskutil mount " & theID
			do shell script theCommand
		end if
	else
		display dialog "Il disco \"" & choice & "\" è già attivo." & return & "Vuoi disattivarlo?" buttons {"Disattiva", "Annulla"} default button 2 with icon 2
		if button returned of the result = "Disattiva" then
			try
				set theCommand to "diskutil unmount " & theID
				do shell script theCommand
			end try
		end if
	end if
end mountUNmount
Frohes scripten
Farid
 
Zurück
Oben Unten