def getpathfrombrowser(context):
    """
    returns path from filebrowser
    """
    for a in context.window.screen.areas:
        if a.type == 'FILE_BROWSER':
            params = a.spaces[0].params
            break
    try:
        params
    except UnboundLocalError:
        return {'CANCELLED'}
    path = params.directory
    return path
