Bluetooth mit AppleScript ausschalten

G

Graundsiro

Mitglied
Thread Starter
Dabei seit
22.12.2003
Beiträge
1.077
Reaktionspunkte
1
Kennt jemand die Zeilen wie man Bluetooth mit einem Script ausschalten kann?
 
Graundsiro schrieb:
Kennt jemand die Zeilen wie man Bluetooth mit einem Script ausschalten kann?

Einschalten-iSync-ausschalten:

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
delay 90
quit
end tell
--
--
--
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

Lass die Teile weg die Du nicht brauchst.

Grüße,
Flo
 
Jo danke... das funktioniert aber es sollte nur ausschalten. Bei erneuter Betätigung darf es nicht einschalten. Am besten ein osa-script das mit cron getriggert werden kann.
Mann... wüsste ich doch wie man Scripts schreibt...:rolleyes:
 
Zuletzt bearbeitet:
Zurück
Oben Unten