Example #1
0
def _itunes_playpause():
    cmd = """
    tell application "iTunes"
        playpause
    end tell
    """ % locals()
    utils.execute_as(cmd)
Example #2
0
def _open_app(app_name):
    cmd = """
    tell application "%(app_name)s" 
        activate
    end tell
    """ % locals()
    utils.execute_as(cmd)
Example #3
0
def _itunes_playpause():
    cmd = """
    tell application "iTunes"
        playpause
    end tell
    """ % locals()
    utils.execute_as(cmd)
Example #4
0
def _open_app(app_name):
    cmd = """
    tell application "%(app_name)s" 
        activate
    end tell
    """ % locals()
    utils.execute_as(cmd)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)