Atalantia
Aktives Mitglied
Thread Starter
- Dabei seit
- 26.11.2009
- Beiträge
- 1.893
- Reaktionspunkte
- 431
Nützlich gegen Tool Partitionen, die es ab und zu auf USB Sticks und sogar auf Festplatten hat. Wer die nicht gemounted haben will kann das mit diesem AppleScript verhindern.
Code:
on open var
doIt(var)
end open
set var to choose folder multiple selections allowed yes
doIt(var)
on doIt(var)
repeat with x in var
tell application "System Events"
set {kindInfo, nameInfo} to {kind of x, name of x}
end tell
if kindInfo ≠ "Volume" then
display alert "Works with volumes only"
return
end if
display dialog "Suspend automount for " & nameInfo & " ?" with icon 1 with title "Auto mount off."
do shell script "echo " & ("UUID=" & (do shell script "diskutil info " & quoted form of POSIX path of x & " | grep UUID | awk '{print $3}'") & " none hfs rw,noauto") & " >> /etc/fstab" with administrator privileges
end repeat
end doIt