Last active
December 31, 2017 17:27
-
-
Save kjaymiller/5c5477a451c0ebc8097b532b851186bf to your computer and use it in GitHub Desktop.
Get YouTube Tab Title from Safari
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
app = Application('Itunes'); | |
app.currentTrack.name() + ' by ' + app.currentTrack.artist() |
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
Safari = Application('Safari'); | |
app = Application.currentApplication(); | |
for (i = 0; i < Safari.windows.length; i++) { | |
var currentTab = Safari.windows[i].tabs[0].name(); | |
if (currentTab.includes('YouTube') == true) { | |
var YouTube = currentTab | |
}; | |
} | |
YouTube |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment