forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopen-tab-in-menubar.applescript
executable file
·77 lines (71 loc) · 2.25 KB
/
open-tab-in-menubar.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
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Open Tabs
# @raycast.mode silent
# Optional parameters:
# @raycast.icon images/menubarx_logo.png
# @raycast.packageName MenubarX
# @raycast.argument1 { "type": "text", "placeholder": "Tabs 1~9" }
# Documentation:
# @raycast.description Open X Tab in your menubar
# @raycast.author Clu Soh
# @raycast.authorURL https://twitter.com/designedbyclu
on run argv
set tabNum to item 1 of argv
if tabNum is equal to "1" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "1" using command down
end tell
else if tabNum is equal to "2" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "2" using command down
end tell
else if tabNum is equal to "3" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "3" using command down
end tell
else if tabNum is equal to "4" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "4" using command down
end tell
else if tabNum is equal to "5" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "5" using command down
end tell
else if tabNum is equal to "6" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "6" using command down
end tell
else if tabNum is equal to "7" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "7" using command down
end tell
else if tabNum is equal to "8" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "8" using command down
end tell
else if tabNum is equal to "9" then
tell application "MenubarX" to activate
delay 0.1
tell application "System Events" to tell process "MenubarX"
keystroke "9" using command down
end tell
end if
end run