Hello, please note that my question could apply to any apps.
As I am working in Bear, I would like to quickly and frequently save the current note as RTF and immediately open that RTF in Scrivener.
It is the jump from save as RTF in one app to open in another app that I am trying to figure out.
I was wondering for example if using variables I could skip bypass actual saving of the file in a folder and opening that file in a new app which is time consuming even in KBM and failure prone.
So Bear is raw Markdown? Then have a look at Markdown.pl, the "other half" of the Markdown equation... See https://daringfireball.net/projects/markdown/. You'd run your text through Markdown and use textutil to convert the resulting HTML to rtf (either writing to a file or putting it onto the clipboard).
There's also pandoc which, amongst many formats, handles Markdown to rtf.
and the Markdown -> RTF leg (whether clipboard or file) is irreducibly non-trivial.
If you are not going to use Bear > Save As > RTF, then as @Nige_S has explained, you will need to use a converter like Pandoc or the orginal Daring FireBall MD -> HTML converter, though that would still leave you with a further HTML -> RTF step
If you are going to use Bear > Save As > RTF then a file is a file, and there are not 48 routes for a file to take into Scrivener.
Neither:
"Save a file as a variable", nor
"from variable open in another app"
have obviously definable meanings.
The two routes into Scrivener are:
importing an RTF file
pasting an RTF clipboard.
If the latter, and Pandoc etc sound too complicated, then you would need a further leg in the process:
RTF file -> RTF clipboard
which is not obviously much less complicated than the MD clipboard -> RTF clipboard leg, which you didn't seem to like the sound of.
In short, Bear's โงโC Copy as Rich Text, followed by a paste in Scrivener, seems the obvious route.
Well, the System Clipboard is a variable. If you can get Rich Text from Bear onto the clipboard (you say no, but @ComplexPoint's post suggests it's possible) then that's the easiest route.
But if you can't then it isn't that complicated. A one-off installation of the Daring Fireball convertor, then make a macro that
Copies the Markdown from Bear to the clipboard
Executes a shell script, which would be something like
A footnote here might be that Pandoc provides MD -> RTF directly โ perhaps marginally simpler than the two leg MD -> HTML -> RTF composition of textutil and the venerable converter provided in Perl by Daring Fireball.
( As it happens, of course, Bear's own Edit > Copy As > Rich Text is probably what the OP needs )
thanks very much. There is a misunderstanding (100% my fault). I was asking a general question and gave Bear as an example, forgetting about โงโC. So you are obviously right. In fact, at the time, I was working on making Panda (Bear's new editor) functional because all kinds of functions are missing. Panda does not have the copy as rtf menu command.
But once again, it is a general question, and I am very surprised that there is not a simple solution for
save as rtf or export to rtf (or any other format) in app 1 โ open that file in app 2
thanks again