Conversion Macro Help

6 views
Skip to first unread message

Storm Dragon

unread,
Apr 18, 2019, 4:10:47 PM4/18/19
to niceeditor
Hi,

I wrote a macro that uses markdown to convert a file written in markdown to html. I wanted it to act as though the file were brand new, so that it would not overwrite the original .md file. Unfortunately, when I add that aspect of the macro, it doesn't work and just leaves me with a blank document. Here is the code:

# Convert current file to html from markdown.

MoveSOF
Mark
MoveEOF
Copy
SaveClip ~/.ne/.tmp.txt
clear
OpenClip ~/.ne/.tmp.txt
MoveSOF
Mark
MoveEOF
Through markdown
System rm -f ~/.ne/.tmp.txt ~/.ne/.tmp.txt.bak

thanks,
Storm
signature.asc

todd_...@unc.edu

unread,
Apr 19, 2019, 9:00:02 AM4/19/19
to niceeditor
Add a "Paste" command after the "OpenClip". "Clear" gives you the empty document; you still have to put something into it.

Storm Dragon

unread,
Apr 19, 2019, 10:38:44 AM4/19/19
to nicee...@googlegroups.com
Hi,

Awesome, thanks for the help. It's always nice when it is something simple like that. Is there a way to keep the current document unmodified and start a new document with the output of the conversion? I tried NewDoc but that just replaces the current document's text and opens a new blank one.

I would really like to have the md contents in document one, and the html text in a second, unnamed document. If that can't be done, the current way is good enough.
>--
>You received this message because you are subscribed to the Google Groups "niceeditor" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to niceeditor+...@googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.


--
"Have you ever been alone at night, thought you heard footsteps behind, and turned around and no one's there? And as you quicken up your pace you'll find it hard to look again because you're sure that someone's there."
Iron Maiden - Fear of the Dark
signature.asc

todd_...@unc.edu

unread,
Apr 19, 2019, 12:48:46 PM4/19/19
to niceeditor
Seems like there ought to be a way, but there isn't. It's a quirk of how macros are implemented: macros won't operate across multiple documents. I'm sure there was a reason for this decision way back, but it should probably be revisited. Until then, I'm afraid you're stuck doing that part of your workflow manually. Sorry.
>To unsubscribe from this group and stop receiving emails from it, send an email to nicee...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages