Created
June 7, 2018 02:42
-
-
Save whobutsb/c5378eeb7ecb6d87506f3b7ee8f9039e to your computer and use it in GitHub Desktop.
AppleScript to Play and Pause SoundCloud
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
on alfred_script(q) | |
tell application "Google Chrome" | |
set allWins to every window | |
set allTabs to {} | |
repeat with currWin in allWins | |
set allTabs to allTabs & every tab of currWin | |
end repeat | |
repeat with currTab in allTabs | |
try | |
if (URL of currTab) starts with "https://soundcloud.com" or "http://soundcloud.com" then set musicTab to currTab | |
end try | |
end repeat | |
tell musicTab to execute javascript "document.querySelector('.playControl').click();" | |
end tell | |
end alfred_script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment