Skip to content

Instantly share code, notes, and snippets.

@b7w
Created March 7, 2015 13:10
Show Gist options
  • Save b7w/a90524aa9641861e8f17 to your computer and use it in GitHub Desktop.
Save b7w/a90524aa9641861e8f17 to your computer and use it in GitHub Desktop.
Sync devices
# -*- coding: utf-8 -*-
from click import group, argument
from ScriptingBridge import SBApplication
@group()
def main():
pass
@main.command()
@argument('name')
def sync(name):
itunes = SBApplication.applicationWithBundleIdentifier_("com.apple.iTunes")
for src in itunes.sources():
if src.name() == name:
src.update()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment