I found out that a better way to do this is cmds.file(query=True, sceneName=True)