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/4b9a9598f6eb58fe96707cb900b3cd5a to your computer and use it in GitHub Desktop.
Save GitMurf/4b9a9598f6eb58fe96707cb900b3cd5a to your computer and use it in GitHub Desktop.
<%*
const search = app.workspace.getLeavesOfType("search")[0];
let thisFile = app.workspace.getActiveFile();
//SortOrder Options: alphabeticalReverse, alphabetical, byModifiedTime, byModifiedTimeReverse, byCreatedTime, byCreatedTimeReverse
search.view.setSortOrder("byCreatedTime");
//Collapse=true, Expand=false
search.view.setCollapseAll(false);
//Show Extra Context: true or false
search.view.setExtraContext(true);
const noteName = tp.file.title;
const myString = await tp.system.prompt("Task Keyword", noteName);
search.view.setQuery(`((file:(${myString}) "[ ]") OR section:(--${myString} "[ ]") OR section:(--${myString} section:("[ ]"))) -file:inbox`);
app.workspace.revealLeaf(search);
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment