def applescriptify(s):
    """Escape string for insertion into an AppleScript string.

    .. versionadded:: 1.31

    Replaces ``"`` with `"& quote &"`. Use this function if you want

    to insert a string into an AppleScript script:
        >>> query = 'g "python" test'
        >>> applescriptify(query)
        'g " & quote & "python" & quote & "test'

    Args:
        s (unicode): Unicode string to escape.

    Returns:
        unicode: Escaped string

    """
    return s.replace(u'"', u'" & quote & "')
