def GetActiveFileName(bAutoSave=1):
 pathName = None
 active = GetActiveView()
 if (active is None):
  return None
 try:
  doc = active.GetDocument()
  pathName = doc.GetPathName()
  if (bAutoSave and ((len(pathName) > 0) or (doc.GetTitle()[:8] == 'Untitled') or (doc.GetTitle()[:6] == 'Script'))):
   if doc.IsModified():
    try:
     doc.OnSaveDocument(pathName)
     pathName = doc.GetPathName()
     linecache.clearcache()
    except win32ui.error:
     raise KeyboardInterrupt
 except (win32ui.error, AttributeError):
  pass
 if (not pathName):
  return None
 return pathName

def GetActiveFileName ( bAutoSave = 1 ) : pathName = None active = GetActiveView ( ) if ( active is None ) : return None try : doc = active . GetDocument ( ) pathName = doc . GetPathName ( ) if ( bAutoSave and ( ( len ( pathName ) > 0 ) or ( doc . GetTitle ( ) [ : 8 ] == 'Untitled' ) or ( doc . GetTitle ( ) [ : 6 ] == 'Script' ) ) ) : if doc . IsModified ( ) : try : doc . OnSaveDocument ( pathName ) pathName = doc . GetPathName ( ) linecache . clearcache ( ) except win32ui . error : raise KeyboardInterrupt except ( win32ui . error , AttributeError ) : pass if ( not pathName ) : return None return pathName
gets the file name for the active frame .