This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| const addPageBrackets = false; //true = '[[page]]' ... false = 'page' | |
| const files = await app.vault.getMarkdownFiles(); | |
| const links = []; | |
| const finalLinkArr = []; | |
| files.forEach(file => { | |
| links.push(file.basename); | |
| finalLinkArr.push('📄 ' + file.basename); | |
| }); | |
| const unResLinks = Object.entries(app.metadataCache.unresolvedLinks); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| let dueDateStr = await tp.system.prompt("Enter Date", "Tomorrow"); | |
| let parseResult; | |
| let parseResultLink; | |
| let myString = ''; | |
| if(dueDateStr) { | |
| let findDays = dueDateStr.split(';'); | |
| let myDateStr = findDays[0]; | |
| if(myDateStr) { | |
| let nlDatesPlugin = this.app.plugins.getPlugin('nldates-obsidian'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| const search = app.workspace.getLeavesOfType("search")[0]; | |
| search.view.setSortOrder("byCreatedTime"); | |
| search.view.setCollapseAll(false); | |
| search.view.setExtraContext(true); | |
| const dnp = tp.date.now('YYYY-MM-DD'); | |
| const dnp2 = tp.date.now('YYYY_MM_DD'); | |
| let myString = `((file:${dnp2} task-todo:"[ ]") OR ((/Due Date: .*\\[\\[${dnp}\\]\\].*/ OR /due date: \\[[0-9, -]*${dnp}[0-9, -]*\\]/) task-todo:"[ ]") OR (file:${dnp} task-todo:"[ ]") OR (task-todo:"${dnp}") OR section:(/^\#.*${dnp}/ "[ ]") OR section:(/^\#.*${dnp}/ section:("[ ]"))) -file:("weekly review")`; | |
| search.view.setQuery(`${myString}`); | |
| app.workspace.revealLeaf(search); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| const search = app.workspace.getLeavesOfType("search")[0]; | |
| const dnp = tp.date.now('YYYY-MM-DD'); | |
| const dnp2 = tp.date.now('YYYY_MM_DD'); | |
| search.view.setSortOrder("byCreatedTime"); | |
| search.view.setCollapseAll(false); | |
| search.view.setExtraContext(true); | |
| //looking for backlinks only | |
| let finalQuery = `/\\[\\[${dnp}(\\]\\]|\\|)/`; | |
| //Optional - looking for date with underscores too |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| let dueDateStr = await tp.system.prompt("Enter Date", "Tomorrow"); | |
| let parseResult; | |
| let parseResultLink; | |
| if(dueDateStr) { | |
| let nlDatesPlugin = this.app.plugins.getPlugin('nldates-obsidian'); | |
| parseResult = nlDatesPlugin.parseDate(dueDateStr); | |
| if(parseResult){parseResultLink = parseResult.formattedString;} | |
| } | |
| if(parseResultLink) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| //Find leaf next door | |
| const thisLeaf = app.workspace.activeLeaf; | |
| const thisFile = thisLeaf.view.file; | |
| let leafToUse = app.workspace.getAdjacentLeafInDirection(thisLeaf, "right"); | |
| if(!leafToUse){leafToUse = app.workspace.getAdjacentLeafInDirection(thisLeaf, "left");} | |
| if(!leafToUse){leafToUse = app.workspace.getAdjacentLeafInDirection(thisLeaf, "bottom");} | |
| if(!leafToUse){leafToUse = app.workspace.getAdjacentLeafInDirection(thisLeaf, "top");} | |
| if(leafToUse) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| const curPane = document.querySelector(`.mod-active.workspace-leaf`); | |
| let isMax = false; | |
| if(curPane) { | |
| if(curPane.style.minWidth) { | |
| if(curPane.style.minWidth === `100%`){isMax = true} | |
| } | |
| } | |
| const rootPanesCont = document.querySelector(`.workspace-split.mod-root`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :root { | |
| /* Vertical Masonry */ | |
| --leaf-height: 480px; | |
| --scroll-width: 20px; | |
| /* Horizontal Masonry */ | |
| /* Split Screen: 930px ... Thirds: 570px or 600px (main ext monitor) */ | |
| --leaf-width: 600px; | |
| --leaf-height-child: 700px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| const openInNewPane = false; //If false, will save link to clipboard | |
| const folderName = `refactor`; | |
| const firstVal = await tp.system.prompt("First thought to add to the new note"); | |
| //Client name | |
| const files = await app.vault.getMarkdownFiles(); | |
| const links = []; | |
| const finalLinkArr = []; | |
| files.forEach(file => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%* | |
| //v1.0 | |
| let cmEditorAct = this.app.workspace.activeLeaf.view.editor; | |
| let curLine = cmEditorAct.getCursor().line; | |
| cmEditorAct.setSelection({ line: curLine, ch: 0 }, { line: curLine, ch: 9999 }); | |
| let dueDateStr = await tp.system.prompt("Due Date"); | |
| let parseResult; | |
| let parseResultLink; | |
| if(dueDateStr) { |