Last active
May 22, 2018 07:47
-
-
Save kunicmarko20/956b86e49d364648db4618339f964b7b to your computer and use it in GitHub Desktop.
Helper Scripts for non mac Keyboard
This file contains hidden or 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
# F3 - Mission Control | |
do shell script "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control" | |
# Next Youtube video in Google Chrome | |
tell application "Google Chrome" | |
repeat with t in tabs of windows | |
tell t | |
if URL starts with "http://www.youtube.com/watch" or URL starts with "https://www.youtube.com/watch" then | |
execute javascript " | |
var player = document.getElementById('movie_player') || document.getElementsByTagName('embed')[0]; | |
if (player) { | |
document.getElementsByClassName('ytp-next-button')[0].click() | |
} | |
" | |
exit repeat | |
end if | |
end tell | |
end repeat | |
end tell | |
# Previous Youtube video in Google Chrome | |
tell application "Google Chrome" | |
repeat with t in tabs of windows | |
tell t | |
if URL starts with "http://www.youtube.com/watch" or URL starts with "https://www.youtube.com/watch" then | |
execute javascript "window.history.back();" | |
exit repeat | |
end if | |
end tell | |
end repeat | |
end tell | |
# Play/Pause Youtube in Google Chrome | |
tell application "Google Chrome" | |
repeat with t in tabs of windows | |
tell t | |
if URL starts with "http://www.youtube.com/watch" or URL starts with "https://www.youtube.com/watch" then | |
execute javascript " | |
var player = document.getElementById('movie_player') || document.getElementsByTagName('embed')[0]; | |
if (player) { | |
document.getElementsByClassName('ytp-play-button')[0].click(); | |
} | |
" | |
exit repeat | |
end if | |
end tell | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment