Je umfangreicher und detaillierter die Infos die man im Supportfalle bekommen kann sind, umso eher kommt man einem Problem auf die Schliche. Um als Admin den User mit der Problemsuche möglichst wenig zu belasten, habe ich mir mal folgendes Script zusammengebastelt, das dem User eigentlich nur noch einen einzigen Mausklick abverlangt. Und selbst den könnte man evtl. sogar noch wegrationalisieren, aber beim Versenden von Daten ist es nicht nur eine Frage der Machbarkeit/Bequemlichkeit, sondern auch des Vertrauens wenn das Senden der User anstossen muss. Ausserdem bleibt ihm so die Möglichkeit evtl. weitere Infos in die Mail zu schreiben.
set theHost to do shell script "hostname"
set theUser to do shell script "whoami"
set theCmd to "system_profiler > /Users/" & theUser & "/Desktop/sysprof.txt"
do shell script theCmd
set theAttachment to "/Users/" & theUser & "/Desktop/sysprof.txt"
set theSubject to "System Profiler | " & theHost
set theContent to "Systemprofil im Anhang"
set theSenderAdress to "sysprof@" & theHost
set theRecipient to "Admin"
set theRecipientAdress to "admin@firma.de"
tell application "Mail"
set newMessage to make new outgoing message with properties {subject:theSubject, content:theContent & return & return}
tell newMessage
set visible to true
-- set sender to theSenderAdress
make new to recipient at end of to recipients with properties {name:theRecipient, address:theRecipientAdress}
tell content
make new attachment with properties {file name:theAttachment} at after the last paragraph
end tell
activate
-- send newMessage
end tell
end tell
Das Script ruft System Profiler auf, und speichert die gesammelten Daten in die Datei “sysprof.txt”, und verschickt diese Datei dann per Mail an den Admin.
Veränderungen/Erweiterungen sind natürlich beinahe endlos möglich.