Skip to content

Instantly share code, notes, and snippets.

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 GitMurf/33e27f28683676b011d4d15710652030 to your computer and use it in GitHub Desktop.
Save GitMurf/33e27f28683676b011d4d15710652030 to your computer and use it in GitHub Desktop.
Run this templater script to open the Search sidebar and search for all open Tasks on the current page
<%*
const search = app.workspace.getLeavesOfType("search")[0];
let thisFile = app.workspace.getActiveFile();
search.view.setSortOrder("byCreatedTime");
search.view.setCollapseAll(false);
search.view.setExtraContext(true);
let myString = thisFile.basename;
search.view.setQuery(`file:("${myString}") task-todo:(/^./)`);
app.workspace.revealLeaf(search);
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment