geöffnete Fenster zählen

MichaHo

Mitglied
Thread Starter
Dabei seit
09.11.2010
Beiträge
121
Reaktionspunkte
8
Hallo,

ich steh grad mächtig auf dem Schlauch.

ich möchte gerne abfragen, wieviele Fenster der gerade aktiven Anwendung geöffnet sind um sie dann, abhängig von der Anzahl, auf dem Desktop anzuordnen.

hier mein Code Schnipsel, der mir immer 0 raus schmeißt, egal wieviel Fenster offen sind:

Code:
[FONT="Verdana"][size=2][b]tell[/b] [color=#0000FF][i]application[/i][/color] "System Events"
	[b]set[/b] [color=#3F7F00]frontApp[/color] [b]to[/b] [color=#6C04D4]name[/color] [b]of[/b] [b]first[/b] [color=#0000FF][i]application process[/i][/color] [b]whose[/b] [color=#6C04D4]frontmost[/color] [b]is[/b] [color=#6C04D4][i]true[/i][/color]
[b]end[/b] [b]tell[/b]


[b]tell[/b] [color=#0000FF][i]application[/i][/color] [color=#3F7F00]frontApp[/color]
	[b]set[/b] [color=#3F7F00]theWindow[/color] [b]to[/b] [color=#0000FF][b]count[/b][/color] [b]of[/b] [b]every[/b] [color=#0000FF][i]window[/i][/color] [b]of[/b] [color=#3F7F00]frontApp[/color]
	[color=#0016B0][b]display dialog[/b][/color] [color=#3F7F00]theWindow[/color]
[b]end[/b] [b]tell[/b]
[/size][/FONT]

kann mir bitte jemand auf die Sprünge helfen?

Vielen Dank

Grüße

Micha
 

Pill

Aktives Mitglied
Dabei seit
21.02.2011
Beiträge
3.280
Reaktionspunkte
463
Code:
[B]tell [/B][COLOR=#0433FF][FONT=Verdana][I]application[/I][/FONT][/COLOR][FONT=Verdana] "System Events"
[/FONT][COLOR=#0433FF][COLOR=#000000][FONT=Verdana]    [B]get [/B] [/FONT][/COLOR][B][FONT=Verdana]count [/FONT][/B][I]windows[/I][COLOR=#000000][FONT=Verdana] [B]of[/B] ([B]first[/B] [/FONT][/COLOR][I]application process[/I][COLOR=#000000][FONT=Verdana] [B]whose[/B] [/FONT][/COLOR][COLOR=#812fdc][FONT=Verdana]frontmost[/FONT][/COLOR][COLOR=#000000][FONT=Verdana] [B]is[/B] [/FONT][/COLOR][COLOR=#812fdc][FONT=Verdana][I]true[/I][/FONT][/COLOR][COLOR=#000000][FONT=Verdana])[/FONT][/COLOR][/COLOR]
[B]end [/B][B]tell[/B]
 

MichaHo

Mitglied
Thread Starter
Dabei seit
09.11.2010
Beiträge
121
Reaktionspunkte
8
Hi Pill,

danke, das funktioniert super.

P.S. du meintest
Code:
count
.

ich hab das Script jetzt so angepasst:

Code:
[FONT="Verdana"][size=2][b]tell[/b] [color=#0000FF][i]application[/i][/color] "System Events"
	[b]set[/b] [color=#3F7F00]frontApp[/color] [b]to[/b] [color=#6C04D4]name[/color] [b]of[/b] [b]first[/b] [color=#0000FF][i]application process[/i][/color] [b]whose[/b] [color=#6C04D4]frontmost[/color] [b]is[/b] [color=#6C04D4][i]true[/i][/color]
	[b]set[/b] [color=#3F7F00]theWindow[/color] [b]to[/b] [b]get[/b] [color=#0000FF][b]count[/b][/color] [color=#0000FF][i]windows[/i][/color] [b]of[/b] ([b]first[/b] [color=#0000FF][i]application process[/i][/color] [b]whose[/b] [color=#6C04D4]frontmost[/color] [b]is[/b] [color=#6C04D4][i]true[/i][/color])
[b]end[/b] [b]tell[/b]



[color=#0016B0][b]display dialog[/b][/color] [color=#3F7F00]frontApp[/color] & " - " & [color=#3F7F00]theWindow[/color][/size][/FONT]

Vielen Dank

Grüße

Micha
 
Oben