Skip to content

Instantly share code, notes, and snippets.

@kjaymiller
Last active December 31, 2017 17:27
Show Gist options
  • Save kjaymiller/5c5477a451c0ebc8097b532b851186bf to your computer and use it in GitHub Desktop.
Save kjaymiller/5c5477a451c0ebc8097b532b851186bf to your computer and use it in GitHub Desktop.
Get YouTube Tab Title from Safari
app = Application('Itunes');
app.currentTrack.name() + ' by ' + app.currentTrack.artist()
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