Many times when I have multiple document tabs open I would like to see the document in context to its location in the navigation side bar.
So when I am viewing tab1 I want to see the navigation side bar show the group that the document is in and when I switch to a another tab again I would like to see the navigation bar reflect the group in which the current visible document resides.
I wrote a script that does that for me. But for some reason even though the navigation side bar reflects the location of the document but its parent widow is not highlighted.
Here is an illustration when I clicked on the second tab “blogging with hugo” and execute my script it does the navigation properly and the parent group is highlighted.
But when I click on the the first tab “You Tube Videos” and execute my script it while it does the navigation properly but the parent group is not highlighted.
Can someone help me with this.
Also, being new to AppleScript any suggestion to improve the script would be appreciated.
Here is my script.
tell application id "DNtp"
try
if not (exists think window 1) then error "No window"
set the theThinkWindow to think window 1
if (content record of theThinkWindow) is equal to missing value then error "content record of theThinkWindow is missing value"
set theDocShown to content record of theThinkWindow
set parentOfTheDocShown to parent 1 of theDocShown
set theViewerWindow to viewer window 1
set root of theViewerWindow to parentOfTheDocShown
set selection of theViewerWindow to {theDocShown}
on error theError
display alert theError
return theError -- this ends the applescript when an error occurs
end try
end tell
Thanks
Steven