Skip to content

Instantly share code, notes, and snippets.

<%*
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');
<%*
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`);
<%*
//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) {
<%*
const noteName = tp.file.title;
const queryKeyword = await tp.system.prompt("Keyword for Tasks search query", noteName);
if(queryKeyword) {
tR = `
\`\`\`query
-file:inbox (file:("${queryKeyword}") line:(" [ ] ")) OR (section:(--"${queryKeyword}" " [ ] ")) OR (section:(--"${queryKeyword}" section:(" [ ] ")))
\`\`\`
`
}
@GitMurf
GitMurf / obsidian.templater.pane.send-to-next.js
Created January 8, 2022 04:07
Send the current active line of text or if text is selected, send the selection... to the pane next to the active one
<%*
//OPTIONS: TOP / BOTTOM
const whereToWrite = "TOP";
//OPTIONS: COPY / MOVE
const copyOrMove = "COPY";
//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");}
: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;
}
<%*
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);