Created
April 20, 2021 06:24
-
-
Save wata/e91530ed5bc194b93a1e842eb1b5368b to your computer and use it in GitHub Desktop.
Siriコマンド入力するAppleScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" to tell the front menu bar of process "SystemUIServer" | |
tell (first menu bar item whose description is "Siri") | |
perform action "AXPress" | |
end tell | |
end tell | |
delay 1 | |
tell application "System Events" to tell the process "NotificationCenter" | |
set notifyWindows to every window | |
repeat with notifyWindow in notifyWindows | |
if description of notifyWindow is "システムダイアログ" then | |
set elements to entire contents of notifyWindow | |
tell (first text field of first group of first UI element of first scroll area of notifyWindow) | |
set focused to true | |
set value to "宇多田ヒカルの曲を流して" | |
perform action "AXConfirm" | |
end tell | |
exit repeat | |
end if | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment