Skip to content

Instantly share code, notes, and snippets.

@KenshoFujisaki
Created August 9, 2020 20:48
Show Gist options
  • Save KenshoFujisaki/71a1d3e0803eb8777bf757209a34751c to your computer and use it in GitHub Desktop.
Save KenshoFujisaki/71a1d3e0803eb8777bf757209a34751c to your computer and use it in GitHub Desktop.
AppleScriptでGoogleChrome拡張ボタンを押下するテスト
-- cf. https://forum.keyboardmaestro.com/t/clicking-specific-chrome-extension-buttons/11950/17
-- GoogleChromeでのイベント名取得確認
tell application "Google Chrome"
activate
delay 0.3
end tell
tell application "System Events"
tell front window of (first application process whose frontmost is true)
set uiElems to entire contents
end tell
end tell
-- GoogleChromeで現在タブにて「Video Downloader Professional」を名称マッチでボタン押下する
tell application "Google Chrome"
activate
delay 0.3
end tell
tell application "System Events"
tell process "Google Chrome"
tell (first window whose subrole is "AXStandardWindow")
tell group 1
tell (first button whose name contains "Video Downloader")
click
--perform action "AXPress"
end tell
end tell
end tell
end tell
end tell
@KenshoFujisaki
Copy link
Author

YosemiteからAppleScriptの代わりにJavascript(JXA)が使えるようになっている
あまり情報がないけれど…
https://highmoon-miyabi.net/blog/2017/04/14_000443.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment