Sending rich-text input, independent of program hotkeys?
Posted: 22 Apr 2019, 06:57
Is it possible to attach rich text formatting to a string sent to software?
Usecase: In Physics, vectors are commonly written as bold, upright characters. For instance, inserting the vector r in MS Office equations corresponds to sending ^b^ir^b^i*. However, this is somewhat brittle:
In similar circumstances, I am often using the clipboard variable, and sending the text using ^v. I am not aware of any method to achieve rich-text formatting in this context.
------------------------------------------
* Just sending the plain keysequence doesn't work actually; It will result in weird behavior inside nested parantheses. Instead I sprinkled some Sleep invocations into the process.
Usecase: In Physics, vectors are commonly written as bold, upright characters. For instance, inserting the vector r in MS Office equations corresponds to sending ^b^ir^b^i*. However, this is somewhat brittle:
- It has to assume, that the current font is "italic, non-bold". As a consequence it fails e.g. in headings, or when italics have been disabled in the equation for some reason (e.g. because the vector as preceded by an upright keyword).
- I have to use German office on some devices, where the hotkeys don't match.
In similar circumstances, I am often using the clipboard variable, and sending the text using ^v. I am not aware of any method to achieve rich-text formatting in this context.
------------------------------------------
* Just sending the plain keysequence doesn't work actually; It will result in weird behavior inside nested parantheses. Instead I sprinkled some Sleep invocations into the process.