per AppleScript alle Spaces schliessen???

gustavmega

Aktives Mitglied
Thread Starter
Dabei seit
19.12.2004
Beiträge
1.825
Reaktionspunkte
26
Hallo,

ist es möglich per AppleScript alle Spaces (Schreibtische) zu schliessen?
 
Hallo,

folgendes Skript schließt alle Spaces bis auf den ersten. Programme im Fullscreenmodus bleiben ebenfalls geöffnet:

Code:
[B]tell [/B][COLOR=#0433FF][FONT=Verdana][I]application[/I][/FONT][/COLOR][FONT=Verdana] "System Events"
[/FONT][FONT=Verdana]    [B]tell[/B] [B]me[/B] [B]to[/B] [COLOR=#012fbe][B]do shell script[/B][/COLOR] "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control"[/FONT]
[FONT=Verdana]    [B]tell[/B] [COLOR=#0433ff][I]process[/I][/COLOR] "Dock"[/FONT]
[FONT=Verdana]        [B]set[/B] [COLOR=#4f8f00]countSpaces[/COLOR] [B]to[/B] [COLOR=#0433ff][B]count[/B][/COLOR] [COLOR=#0433ff][I]buttons[/I][/COLOR] [B]of[/B] [B]the[/B] [B]first[/B] [COLOR=#0433ff][I]group's[/I][/COLOR] [B]first[/B] [COLOR=#0433ff][I]list[/I][/COLOR][/FONT]
[FONT=Verdana]        [B]repeat[/B] [B]until[/B] [COLOR=#4f8f00]countSpaces[/COLOR] [B]is[/B] 0[/FONT]
[FONT=Verdana]            [B]if[/B] [COLOR=#0433ff][B]exists[/B][/COLOR] [COLOR=#0433ff][I]action[/I][/COLOR] "AXRemoveDesktop" [B]of[/B] [COLOR=#0433ff][I]button[/I][/COLOR] [COLOR=#4f8f00]countSpaces[/COLOR] [B]of[/B] [B]the[/B] [B]first[/B] [COLOR=#0433ff][I]group's[/I][/COLOR] [B]first[/B] [COLOR=#0433ff][I]list[/I][/COLOR] [B]then[/B][/FONT]
[FONT=Verdana]                [B]tell[/B] [COLOR=#0433ff][I]button[/I][/COLOR] [COLOR=#4f8f00]countSpaces[/COLOR] [B]of[/B] [B]the[/B] [B]first[/B] [COLOR=#0433ff][I]group's[/I][/COLOR] [B]first[/B] [COLOR=#0433ff][I]list[/I][/COLOR] [B]to[/B] [COLOR=#0433ff][B]perform[/B][/COLOR] [COLOR=#0433ff][I]action[/I][/COLOR] "AXRemoveDesktop"[/FONT]
[FONT=Verdana]            [B]end[/B] [B]if[/B][/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]            [B]set[/B] [/COLOR]countSpaces[COLOR=#000000] [B]to[/B] [/COLOR]countSpaces[COLOR=#000000] - 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]        [B]end[/B] [B]repeat[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]        [/COLOR][B]key code[/B][COLOR=#000000] 53[/COLOR][/FONT][/COLOR]
[FONT=Verdana]    [B]end[/B] [B]tell[/B][/FONT]
[B]end [/B][B]tell[/B]

Hier gibt's noch mehr Spielereien mit Spaces und AppleScript:
https://www.macuser.de/forum/thema/697688-Space-Desktop-mit-Apple-Script-erstellen/page2
 
Hallo,

folgendes Skript schließt alle Spaces bis auf den ersten. Programme im Fullscreenmodus bleiben ebenfalls geöffnet:

Code:
[B]tell [/B][COLOR=#0433FF][FONT=Verdana][I]application[/I][/FONT][/COLOR][FONT=Verdana] "System Events"
[/FONT][FONT=Verdana]    [B]tell[/B] [B]me[/B] [B]to[/B] [COLOR=#012fbe][B]do shell script[/B][/COLOR] "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control"[/FONT]
[FONT=Verdana]    [B]tell[/B] [COLOR=#0433ff][I]process[/I][/COLOR] "Dock"[/FONT]
[FONT=Verdana]        [B]set[/B] [COLOR=#4f8f00]countSpaces[/COLOR] [B]to[/B] [COLOR=#0433ff][B]count[/B][/COLOR] [COLOR=#0433ff][I]buttons[/I][/COLOR] [B]of[/B] [B]the[/B] [B]first[/B] [COLOR=#0433ff][I]group's[/I][/COLOR] [B]first[/B] [COLOR=#0433ff][I]list[/I][/COLOR][/FONT]
[FONT=Verdana]        [B]repeat[/B] [B]until[/B] [COLOR=#4f8f00]countSpaces[/COLOR] [B]is[/B] 0[/FONT]
[FONT=Verdana]            [B]if[/B] [COLOR=#0433ff][B]exists[/B][/COLOR] [COLOR=#0433ff][I]action[/I][/COLOR] "AXRemoveDesktop" [B]of[/B] [COLOR=#0433ff][I]button[/I][/COLOR] [COLOR=#4f8f00]countSpaces[/COLOR] [B]of[/B] [B]the[/B] [B]first[/B] [COLOR=#0433ff][I]group's[/I][/COLOR] [B]first[/B] [COLOR=#0433ff][I]list[/I][/COLOR] [B]then[/B][/FONT]
[FONT=Verdana]                [B]tell[/B] [COLOR=#0433ff][I]button[/I][/COLOR] [COLOR=#4f8f00]countSpaces[/COLOR] [B]of[/B] [B]the[/B] [B]first[/B] [COLOR=#0433ff][I]group's[/I][/COLOR] [B]first[/B] [COLOR=#0433ff][I]list[/I][/COLOR] [B]to[/B] [COLOR=#0433ff][B]perform[/B][/COLOR] [COLOR=#0433ff][I]action[/I][/COLOR] "AXRemoveDesktop"[/FONT]
[FONT=Verdana]            [B]end[/B] [B]if[/B][/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]            [B]set[/B] [/COLOR]countSpaces[COLOR=#000000] [B]to[/B] [/COLOR]countSpaces[COLOR=#000000] - 1[/COLOR][/FONT][/COLOR]
[FONT=Verdana]        [B]end[/B] [B]repeat[/B][/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]        [/COLOR][B]key code[/B][COLOR=#000000] 53[/COLOR][/FONT][/COLOR]
[FONT=Verdana]    [B]end[/B] [B]tell[/B][/FONT]
[B]end [/B][B]tell[/B]

Hier gibt's noch mehr Spielereien mit Spaces und AppleScript:
https://www.macuser.de/forum/thema/697688-Space-Desktop-mit-Apple-Script-erstellen/page2


Danke für die Antwort!
Ich bekomme aber dabei folgende Fehlermeldung:

Code:
error "„System Events“ hat einen Fehler erhalten: Skript-Editor hat keine Berechtigung für den Hilfszugriff." number -1719 from group 1 of process "Dock"
 
Zurück
Oben Unten