-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenubarx-new-and-focus.applescript
65 lines (60 loc) · 1.66 KB
/
menubarx-new-and-focus.applescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# open a new window (cmd+n or cmd+t) and attaches it (cmd+shift+d) it (detached by default)
set max to 3
set i to 0
tell application "MenubarX" to activate
tell application "System Events"
tell process "MenubarX"
tell menu bar 2
set iconCount to (count of menu bar items)
keystroke "n" using {command down}
delay 2
repeat while i < max
set i to i + 1
if (i is equal to max) then return
log "..."
delay 2
if (count of menu bar items) > iconCount
keystroke "d" using {command down, shift down}
-- perform action "AXPress" of menu bar item (count of menu bar items)
exit repeat
else
log "nope"
end if
end repeat
end tell
end tell
end tell
-- tell application "MenubarX" to activate
-- tell application "System Events"
-- tell process "MenubarX"
-- tell menu bar 2
-- set iconCount to (count of menu bar items)
-- set popupCount to (count of pop overs)
-- keystroke "n" using {command down}
-- end tell
-- end tell
-- end tell
-- return
-- delay 2
-- set max to 3
-- set i to 0
-- repeat while i < max
-- set i to i + 1
-- if (i is equal to max) then return
-- delay 2
-- tell application "System Events"
-- tell process "MenubarX"
-- tell menu bar 2
-- if (count of menu bar items) > iconCount then
-- perform action "AXPress" of menu bar item (count of menu bar items) # if (i < max) then perform action "AXPress" of menu bar item (count of menu bar items)
-- if not ((count of pop overs) > popupCount) then
-- keystroke "x" using {option down}
-- set i to 0
-- else
-- exit repeat
-- end if
-- end if
-- end tell
-- end tell
-- end tell
-- end repeat