Open gijigae opened 3 years ago
It does not seem to be working for me. Any idea why?
very similar to this script but a little different:
i copy a small snippet of text with several breaks from say facebook...
when i paste it the text default to several blocks.
what i need is a script that combines all the copied text into one block in Roam.
bonus if the script can place shift+enter breaks instead of the automatic block breaks.
very similar to this script but a little different: i copy a small snippet of text with several breaks from say facebook... when i paste it the text default to several blocks. what i need is a script that combines all the copied text into one block in Roam. bonus if the script can place shift+enter breaks instead of the automatic block breaks.
Does command-shift-V not work for this case? I also use command-alt/opt-shift-V, but that's a really "raw" paste.
Updated the regex to handle various linebreaks. Please see the details in the following thread.
cbText = cbText.replace(/\n/g, " ");
cbText = cbText.replace(/[\n\r]+/g, ' ');
https://twitter.com/yvettepyne/status/1375495353282273291?s=20
Edit (May 26): simply change last line code by return cbText;
for automatic pasting.
Old message: And add this two lines at the end of the SmartBlock for automatic pasting (by @yvettepyne , same Twitter thread as mentionned in previous comment)
- <%SET:Text,<%CLIPBOARDPASTETEXT%>%> <%NOBLOCKOUTPUT%>
- <%GET:Text%>
✂️ Copy of your #42SmartBlock from Roam
📋 Describe the SmartBlock
Have seen many inquiries on unnecessary line breaks while copying text from PDF into Roam. This SB will replace new lines in the clipboard with space.
✅ Describe any prerequisites or dependencies that are required for this SmartBlock
None
📷 Screenshot of your #42SmartBlock workflow/template from Roam
💡 Additional Info