Last active
December 17, 2023 01:03
-
-
Save jocap/38a91c1ab7bd2a360ef591e21af10749 to your computer and use it in GitHub Desktop.
Toggle the Info panel in DEVONthink 3, automatically resizing the window.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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