Exemplo n.º 1
0
def _itunes_playpause():
    cmd = """
    tell application "iTunes"
        playpause
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 2
0
def _open_app(app_name):
    cmd = """
    tell application "%(app_name)s" 
        activate
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 3
0
def _itunes_playpause():
    cmd = """
    tell application "iTunes"
        playpause
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 4
0
def _open_app(app_name):
    cmd = """
    tell application "%(app_name)s" 
        activate
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 5
0
def _quit_app(app_name):
    cmd = """
    if application "%(app_name)s" is running
        tell application "%(app_name)s" to quit
    end if
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 6
0
def _quit_app(app_name):
    cmd = """
    if application "%(app_name)s" is running
        tell application "%(app_name)s" to quit
    end if
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 7
0
def _open_url_in_safari(url):
    width, height = utils.screen_size()
    cmd = """
    tell application "Safari"
        open location "%(url)s"
        activate
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 8
0
def _open_dvdplayer():
    cmd = """
    tell application "DVD Player"
        activate
        set viewer full screen to true
        play dvd
    end tell
    """
    utils.execute_as(cmd)
Exemplo n.º 9
0
def _escape_key():
    if not utils.is_running("Safari"): return
    cmd = """
    tell application "Safari"
        activate
        tell application "System Events" to key code 53
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 10
0
def _safari_reload():
    if not utils.is_running("Safari"): return
    cmd = """
    tell application "Safari"
        activate
        tell application "System Events" to (keystroke "r" using {command down})
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 11
0
def _open_url_in_safari(url):
    width, height = utils.screen_size()
    cmd = """
    tell application "Safari"
        open location "%(url)s"
        activate
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 12
0
def _open_dvdplayer():
    cmd = """
    tell application "DVD Player"
        activate
        set viewer full screen to true
        play dvd
    end tell
    """
    utils.execute_as(cmd)
Exemplo n.º 13
0
def _safari_reload():
    if not utils.is_running("Safari"): return
    cmd = """
    tell application "Safari"
        activate
        tell application "System Events" to (keystroke "r" using {command down})
    end tell
    """ % locals()
    utils.execute_as(cmd)
Exemplo n.º 14
0
def _escape_key():
    if not utils.is_running("Safari"): return
    cmd = """
    tell application "Safari"
        activate
        tell application "System Events" to key code 53
    end tell
    """ % locals()
    utils.execute_as(cmd)