Push-Nachrichten von MacTechNews.de
Würden Sie gerne aktuelle Nachrichten aus der Apple-Welt direkt über Push-Nachrichten erhalten?
Forum>Software>Datum einstellen - AppleScript

Datum einstellen - AppleScript

iKev
iKev11.08.0704:44
Hi, ich bin momentan einen Skript am schreiben, leider ist es mir ein Rätsel wie ich in einem Skript das Datum von OS X verstellen kann, ich kann es nur abfragen
0

Kommentare

_mäuschen
_mäuschen11.08.0712:27

set datum to do shell script "sudo date 061316271985" password thePassword with administrator privileges

0
iKev
iKev11.08.0716:11
danke, dass funktioniert schonmal, leider bekomm ich das datum nachher nicht wieder auf das aktuelle zurückgestellt
0
_mäuschen
_mäuschen11.08.0716:14

TimeServer zurückstellen?

0
iKev
iKev11.08.0716:16
jep
0
_mäuschen
_mäuschen11.08.0716:26

tell application "System Events"
if UI elements enabled then
set tso to false
my toggle_time(tso) -- Time Server off
--
-- Hier code einsetzen
--
set tso to true
my toggle_time(tso) -- Time Server on
else
tell application "System Preferences"
set current pane to pane "com.apple.preference.universalaccess"
display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""
end tell
end if
end tell

on toggle_time(tso)
tell application "Finder" to set visible of every process whose name is "System Preferences" to true --false
tell application "System Preferences" to set current pane to pane id "com.apple.preference.datetime"
tell application "System Events" to tell process "System Preferences"
try
click radio button 1 of tab group 1 of window 1
set dt to value of checkbox 1 of group 1 of tab group 1 of window 1
if dt is 1 and tso is false then
click checkbox 1 of group 1 of tab group 1 of window 1
else
if dt is 0 and tso is true then
click checkbox 1 of group 1 of tab group 1 of window 1
end if
end if
end try
end tell
end toggle_time

0
iKev
iKev11.08.0717:36
das ist ne menge code
ich werde es gleich ausprobieren, wenn ich wieder zu Hause bin

vielen vielen Dank !
0
iKev
iKev12.08.0718:19
hui !
funzt super, danke
0

Kommentieren

Diese Diskussion ist bereits mehr als 3 Monate alt und kann daher nicht mehr kommentiert werden.