Skip to content

Instantly share code, notes, and snippets.

@jocap
Last active December 17, 2023 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jocap/38a91c1ab7bd2a360ef591e21af10749 to your computer and use it in GitHub Desktop.
Save jocap/38a91c1ab7bd2a360ef591e21af10749 to your computer and use it in GitHub Desktop.
Toggle the Info panel in DEVONthink 3, automatically resizing the window.
(function(){
let dt3 = Application("DEVONthink 3");
dt3.includeStandardAdditions = true;
let se = Application("System Events")
let p = se.processes.byName("DEVONthink 3")
let win = dt3.windows()[0]
let toggle = p.menuBars.at(0).menuBarItems.byName("Tools").menus.byName("Tools")
.menuItems.byName("Inspectors").menus.byName("Inspectors").menuItems()[0]
if (win.class() == "documentWindow") {
let isInfoOpen = p.windows[0].uiElements()[0].uiElements().length > 1
let dx = isInfoOpen? -280: 280
var bounds = win.bounds()
bounds.width += dx
win.bounds = bounds
}
dt3.activate()
toggle.click()
delay(0.1)
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment