Skip to content

Instantly share code, notes, and snippets.

@tachekent
Created January 9, 2023 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tachekent/4581978a15a0dc584b63fb0e72da1452 to your computer and use it in GitHub Desktop.
Save tachekent/4581978a15a0dc584b63fb0e72da1452 to your computer and use it in GitHub Desktop.
Browser bookmarklet to quickly capture selected text and URL into a new timestamped note in Obsidian.Requires Advanced URI plugin
javascript:d=new Date();date=d.getFullYear()+'-'+String(d.getMonth()+1).padStart(2,'0')+'-'+String(d.getDate()).padStart(2,'0');time=d.getHours()+'-'+d.getMinutes()+'-'+d.getSeconds();v='Otherhead';f='Inbox/To Process/'+date+'--'+time;p=document.title;q=location.href;if(document.getSelection){s=document.getSelection();}else{s='';};t=`---\ntags: fleetingNotes\n---\n\n[[${date}]]\n# `+p+'\n'+s+'[^1]\n\n'+'[^1]: '+document.URL;void(open('obsidian://advanced-uri?vault='+encodeURIComponent(v)+'&filepath='+encodeURIComponent(f)+'&data='+encodeURIComponent(t)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment