Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Prepare clipboard content for Google Search (this is for you Red) #214

Open
TfTHacker opened this issue Apr 6, 2021 · 1 comment
Open

Comments

@TfTHacker
Copy link
Collaborator

TfTHacker commented Apr 6, 2021

✂️ Copy of your #42SmartBlock from Roam

  • #42SmartBlock Replace Clipboard spaced content with dash
    
    • <%JA:```javascript
      var cb = await navigator.clipboard.readText();
      var fixedText = cb.replaceAll(' ','-');
      await navigator.clipboard.writeText( fixedText );
      roam42.help.displayMessage(`Clipboard text: ${cb}<br/>Changed to: <b>${fixedText}</b>`,5000)
      return '';```%>
      
  •  
    
  • #42SmartBlock Google Search text from clipboard
    
    • <%JA:```javascript
      var cb = await navigator.clipboard.readText();
      var fixedText = cb.replaceAll(' ','-');
      var results = `[Srch](https://www.google.com/search?q=${fixedText})`;
      return results;```%>
      
  •  
    

📋 Describe the SmartBlock

These two SmartBlocks copy the clipboard contents and make them ready for google search. It does this by replacing spaces with a dash -

SB 1: Replace contents of clipboard with spaces replaced with a dash
SB 2: Prepare the google link based on the clipbaord text

📷 Screenshot of your #42SmartBlock workflow/template from Roam

image

More info here:
https://twitter.com/roamhacker/status/1379389298055725058?s=20

@kmaustral
Copy link

Red adds something special to Smartblocks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants