Wanted an action for this so I could map my own keyboard shortcut. With the drafts list is pinned, this will invoke the drafts list if the drafts list is not visible, but fails to hide the drafts list when it’s already visible. Have I overlooked something simple in the script, or is there something I need to do to account for the list’s pinned status?
// Check if the drafts list is currently visible
if (app.currentWindow.isDraftListVisible) {
// Hide the drafts list
app.currentWindow.hideDraftList();
} else {
// Show the drafts list
app.currentWindow.showDraftList();
}