def state_scripts(state):
    """
    returns all the scripts in the state
    """
    json_data = state.data.get('json')
    scripts = []
    if json_data != None:
        scripts.extend(json_data.get('scripts', []))
        for child in json_data.get('children'):
            scripts.extend(child.get('scripts', []))
    return scripts
