forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrename-profile.applescript
executable file
·70 lines (56 loc) · 1.8 KB
/
rename-profile.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
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Rename Profile
# @raycast.description Rename your profile in Zoom Meeting App (Mac Only) and cliclick.
# @raycast.mode silent
# @raycast.packageName Zoom
# @raycast.argument1 { "type": "text", "placeholder": "AFK for?" }
# Optional parameters:
# @raycast.icon images/zoom-logo.png
# Documentation:
# @raycast.author Leo Voon
# @raycast.authorURL https://github.com/leovoon
on run argv
tell application "System Events"
tell application process "zoom.us"
set frontmost to true
set windowIsOpen to false
set participantsWindow to missing value
set renameWindow to missing value
repeat with w in windows
if name of w contains "Participants" then
set windowIsOpen to true
set participantsWindow to w
exit repeat
end if
end repeat
delay 0.5
set foundRename to false
-- Hover on name
do shell script "/opt/homebrew/bin/cliclick m:" & 1183 & "," & 124
delay 0.5
-- Hover on More button
do shell script "/opt/homebrew/bin/cliclick m:" & 1400 & "," & 124
delay 0.5
-- Click More button
do shell script "/opt/homebrew/bin/cliclick c:" & 1400 & "," & 124
delay 0.5
-- Click Arrow Down
do shell script "/opt/homebrew/bin/cliclick kp:arrow-down kp:arrow-down kp:return"
delay 0.5
-- Target Rename and Hit Return Key
do shell script "/opt/homebrew/bin/cliclick kp:return"
-- Edit Input, modify here for your needs
delay 0.5
set newName to "YOUR NAME -" & ( item 1 of argv )
delay 0.5
do shell script "/opt/homebrew/bin/cliclick c:" & 888 & "," & 430
delay 0.5
key code 51 using {command down}
keystroke newName
delay 0.5
do shell script "/opt/homebrew/bin/cliclick c:" & 880 & "," & 517
end tell
end tell
end run