Try this:
document.addEventListener("keydown", (e)=>{
if (e.ctrlKey && e.altKey && e.key === "c") {
const div = document.querySelector(".sidebar-item")
if (!div) return
const span = div.querySelector("span.inline")
if (!span) return
span.dispatchEvent(new MouseEvent("mousedown", {
bubbles: true,
cancelable: true
}))
function escape(){
const ta = div.querySelector(".block-editor")
if (!ta) return
ta.dispatchEvent(new KeyboardEvent("keydown", {
bubbles: true,
keyCode: 27
}))
}
setTimeout(escape, 300)
}
});