Created
March 7, 2015 13:10
-
-
Save b7w/a90524aa9641861e8f17 to your computer and use it in GitHub Desktop.
Sync devices
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
# -*- 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