def get_view_content(file_name):
 active_window = sublime.active_window()
 active_view = active_window.active_view()
 if (active_view.file_name() == file_name):
  return _get_view_content(active_view)
 view = active_window.find_open_file(file_name)
 if view:
  return _get_view_content(view)
 for window in sublime.windows():
  if (window == active_window):
   continue
  view = window.find_open_file(file_name)
  return _get_view_content(view)

def get_view_content ( file_name ) : active_window = sublime . active_window ( ) active_view = active_window . active_view ( ) if ( active_view . file_name ( ) == file_name ) : return _get_view_content ( active_view ) view = active_window . find_open_file ( file_name ) if view : return _get_view_content ( view ) for window in sublime . windows ( ) : if ( window == active_window ) : continue view = window . find_open_file ( file_name ) return _get_view_content ( view )
if the file is open in a view .