- Registriert
- 08.03.08
- Beiträge
- 9
Hallo,
im Netz kursieren ja schon diverse Scripte zu besagtem Problem (Bluetooth einschalten, mit Handy synchronisieren, Bluetooth wieder ausschalten), ich habe mir daraus folgendes zusammengebastelt:
Es funktioniert eigentlich auch, allerdings wird Bluetooth nach dem Synchronisieren nicht abgeschaltet.
Ich habe bereits die Suchfunktion benutzt, leider aber nichts hilfreiches gefunden; wäre nett, wenn mir jemand weiterhelfen könnte.
mfg
im Netz kursieren ja schon diverse Scripte zu besagtem Problem (Bluetooth einschalten, mit Handy synchronisieren, Bluetooth wieder ausschalten), ich habe mir daraus folgendes zusammengebastelt:
Code:
tell application "System Events" to tell the front menu bar of process "SystemUIServer"
try
click bt_menu
tell the second menu item of the front menu of bt_menu to if title contains "Bluetooth" then
click
else
error
end if
on error
repeat with x in menu bar items
click x
try
if the title of the first menu item of the front menu of x starts with "Bluetooth" then exit repeat
end try
end repeat
set bt_menu to x
try
tell the second menu item of the front menu of bt_menu to if title contains "Bluetooth" then
click
else
error
end if
on error
click bt_menu
display alert "Bluetooth Menu Extra not found."
end try
end try
end tell
--
--
--
tell application "iSync"
synchronize
repeat while (syncing is true)
delay 5
end repeat
set syncStatus to sync status
if syncStatus = 2 then
-- Success
quit
else
if syncStatus = 3 then
set syncStatus to "completed with warnings"
else if syncStatus = 4 then
set syncStatus to "completed with errors"
else if syncStatus = 5 then
set syncStatus to "last sync cancelled"
else if syncStatus = 6 then
set syncStatus to "last sync failed to complete"
else if syncStatus = 7 then
set syncStatus to "never synced"
end if
display dialog "syncStatus: " & syncStatus
syncStatus
end if
end tell
--
--
--
delay 5
tell application "System Events" to tell the front menu bar of process "SystemUIServer"
try
click bt_menu
tell the second menu item of the front menu of bt_menu to if title contains "Bluetooth" then
click
else
error
end if
on error
repeat with x in menu bar items
click x
try
if the title of the first menu item of the front menu of x starts with "Bluetooth" then exit repeat
end try
end repeat
set bt_menu to x
try
tell the second menu item of the front menu of bt_menu to if title contains "Bluetooth" then
click
else
error
end if
on error
click bt_menu
display alert "Bluetooth Menu Extra not found."
end try
end try
end tell
Ich habe bereits die Suchfunktion benutzt, leider aber nichts hilfreiches gefunden; wäre nett, wenn mir jemand weiterhelfen könnte.
mfg