> > I'm using mutt in a desktop environment, would like to know if there's > > a way (any) to make mutt go to a specific email from an external > > program/script, mutt could be in a different mailbox, ideally this > > should change too. > > I believe you mean “Is there a way to control an already-running mutt > instance so that it goes to a specific mail message”?
Yes > One way to do it would involve running mutt in either tmux or screen, > and use them as a keyboard input proxy. You can send keypresses to an > already running program using “tmux send-keys” or “screen -X stuff” (see > their manpage for details, or examples on ServerFault¹). Guess AutoKey or xdotool will do too. I know how to search the message but what a good mutt macro to change the mailbox given the mailbox path? > But that's the easy part. The real tricky part is to find a safe > sequence of keypresses to go to a specific message, no matter what the > current context of mutt is (pager, index, ...). What if you're in the > middle of composing an e-mail in mutt? should mutt discard your message > to switch to your specific e-mail? what if you're currently in an > external editor or shell? I think would be reasonable while is idling on index/pager (wondering if there's a way to check if the mutt process is in foreground) > Unless somebody comes up with something really clever, I'd strongly > suggest you consider spawning a different instance of mutt instead; > much, *much* simpler and foolproof. For some reason I didn't think about this... eventually will be a nice fall back. Thank you!