Skip to content

Commit

Permalink
working on getActiveFolder
Browse files Browse the repository at this point in the history
  • Loading branch information
quintijn committed Mar 13, 2024
1 parent ae24c8d commit ef36bf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/unimacro/UnimacroGrammars/_clickbyvoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,6 @@ def fillInstanceVariables(self):





finally:
thisGrammar.unload()
elif __name__.find('.') == -1:
Expand Down
10 changes: 7 additions & 3 deletions src/unimacro/UnimacroGrammars/_folders.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,14 @@ def getActiveFolder(self, hndle=None, className=None):
if os.path.isdir(f):
nf = os.path.normpath(f)
if nf != self.prevActiveFolder:
self.debug("getActiveFolder: %s",nf)
self.debug("getActiveFolder, got: %s",nf)
self.prevActiveFolder = nf
return nf
self.warning(f'getActiveFolder, strange invalid path for folder: "{f}"' )
result = extenvvars.getFolderFromLibraryName(f)
if result and os.path.isdir(f):
self.debug("getActiveFolder, via getFolderFromLibraryName %s: %s", f, result)
return os.path.normpath(result)
self.warning('getActiveFolder, strange invalid path for folder: %s', f)
return None

def fillListsForActiveFolder(self, activeFolder):
Expand Down Expand Up @@ -2446,7 +2450,7 @@ def unload():

# get hndle of a explore window (via _general "give window info") and try interactive
# thisGrammar.catchTimerRecentFolders(132524, "CabinetWClass")
# thisGrammar.getActiveFolder(329491)
thisGrammar.getActiveFolder(67062)
thisGrammar.displayRecentFolders()

# # Words = ['folder', 'dtactions']
Expand Down

0 comments on commit ef36bf1

Please sign in to comment.