├── AskForDateForMeeting.js ├── CRM_Macro.js ├── CheckboxBrightBackground.css ├── Dashboard ├── Dashboard.css ├── Dataview.css ├── FinishMeeting.js ├── New case template ├── New meeting template for QuickAdd ├── SetupNewCustomer.js ├── Use full length for note.css └── VaultToShare.zip /AskForDateForMeeting.js: -------------------------------------------------------------------------------- 1 | // You have to export the function you wish to run. 2 | // QuickAdd automatically passes a parameter, which is an object with the Obsidian app object 3 | // and the QuickAdd API (see description further on this page). 4 | module.exports = async (params) => { 5 | // Object destructuring. We pull inputPrompt out of the QuickAdd API in params. 6 | const { app } = params; 7 | 8 | const activeFile = this.app.workspace.getActiveFile(); 9 | 10 | // Ask for meeting date 11 | 12 | let inputDate = await params.quickAddApi.inputPrompt("Meeting date"); 13 | 14 | let parsedDate = moment(inputDate); 15 | 16 | // Adjust year to future if needed 17 | 18 | const dateNow = moment(); 19 | 20 | parsedDate.year( 21 | parsedDate.dayOfYear() >= dateNow.dayOfYear() 22 | ? dateNow.year() 23 | : dateNow.year() + 1 24 | ); 25 | 26 | const dateFormatted = parsedDate.format("YYYY-MM-DD"); 27 | const todoDateFormatted = parsedDate.subtract(1, "days").format("YYYY-MM-DD"); 28 | 29 | // Ask for project 30 | 31 | const meetingProject = await params.quickAddApi.suggester( 32 | (file) => file.basename, 33 | params.app.vault.getMarkdownFiles() 34 | ); 35 | 36 | // Insert values 37 | await params.quickAddApi.executeChoice("PasteMeetingInfo", { 38 | DATE: dateFormatted, 39 | PROJECT: meetingProject.basename, 40 | TODODATE: todoDateFormatted, 41 | }); 42 | 43 | // Change file name 44 | await app.fileManager.renameFile( 45 | activeFile, 46 | activeFile.basename + 47 | " " + 48 | meetingProject.basename + 49 | " - " + 50 | dateFormatted + 51 | ".md" 52 | ); 53 | 54 | // Move file to customer folder 55 | 56 | await app.fileManager.renameFile( 57 | activeFile, 58 | "Customers/" + meetingProject.basename + "/" + activeFile.name 59 | ); 60 | }; 61 | -------------------------------------------------------------------------------- /CRM_Macro.js: -------------------------------------------------------------------------------- 1 | // You have to export the function you wish to run. 2 | // QuickAdd automatically passes a parameter, which is an object with the Obsidian app object 3 | // and the QuickAdd API (see description further on this page). 4 | module.exports = async (params) => { 5 | // Object destructuring. We pull inputPrompt out of the QuickAdd API in params. 6 | const { 7 | quickAddApi: { executeChoice }, 8 | } = params; 9 | const pickedFile = await params.quickAddApi.suggester( 10 | (file) => file.basename, 11 | params.app.vault.getMarkdownFiles() 12 | ); 13 | let TAG = ""; 14 | if (pickedFile.basename === "MYCOMPANY") { // Change to your company 15 | TAG = "Colleague"; 16 | } else { 17 | TAG = "Customer"; 18 | } 19 | await params.quickAddApi.executeChoice("PasteInfo", { 20 | EMPLOYER: pickedFile.basename, 21 | TAG: TAG, 22 | }); 23 | }; 24 | -------------------------------------------------------------------------------- /CheckboxBrightBackground.css: -------------------------------------------------------------------------------- 1 | .task-list-item-checkbox { 2 | background: #fffbf5; 3 | } 4 | -------------------------------------------------------------------------------- /Dashboard: -------------------------------------------------------------------------------- 1 | --- 2 | cssclass: maxWidth, dashboard 3 | --- 4 | 5 | ````ad-dashb 6 | title: Today 7 | color: 245, 229, 12 8 | icon: calendar-today 9 | - ## ☝️ Must do today 10 | ```tasks 11 | not done 12 | due before in 1 day 13 | hide start date 14 | hide due date 15 | hide scheduled date 16 | hide edit button 17 | ``` 18 | - ## 🤝🏼 Meetings 19 | ```dataview 20 | list WITHOUT ID project + " - " + "[["+file.name+"]]" 21 | FROM #meeting and -#held 22 | WHERE contains(date(Date), date(today)) 23 | ``` 24 | - ## 📮 Inbox 25 | ```tasks 26 | not done 27 | no due date 28 | description does not include # 29 | no scheduled date 30 | path does not include Templates 31 | ``` 32 | ```` 33 | 34 | ````ad-dashb 35 | title: Work 36 | icon: briefcase 37 | - ## 💪 Try to do today 38 | ```tasks 39 | not done 40 | scheduled before in 1 day 41 | hide start date 42 | hide due date 43 | hide scheduled date 44 | hide edit button 45 | limit 5 46 | ``` 47 | - ## 📅 Upcoming 48 | ```tasks 49 | not done 50 | due before in 3 days 51 | due after in 0 days 52 | hide start date 53 | hide scheduled date 54 | hide edit button 55 | limit 5 56 | ``` 57 | - ## 🍅 / ☑️ Completed 58 | ```tracker 59 | searchType: text, dvField, text 60 | searchTarget: 🍅, ignore, ☑️ 61 | datasetName: pomodoros, reference, tasks 62 | folder: / 63 | startDate: -6d 64 | endDate: 0d 65 | accum: true, false, true 66 | penalty: 0, 10, 0 67 | fitPanelWidth: true 68 | line: 69 | showLine: true 70 | yAxisLabel: Nbr 71 | xAxisLabel: Date 72 | showPoint: false, false, false 73 | yMin: 0 74 | fillGap: true 75 | lineColor: "red, #A9D4C0, blue" 76 | ``` 77 | ```` 78 | 79 | ````ad-dashb 80 | title: All todos 81 | icon: list 82 | collapse: true 83 | color: 3, 135, 36 84 | - ## 🆙 With due-date 85 | ```tasks 86 | not done 87 | due after 1999-01-01 88 | hide edit button 89 | hide start date 90 | ``` 91 | - ## ⬜ Other tasks 92 | ```tasks 93 | not done 94 | scheduled before in 90 days 95 | scheduled after in 1 days 96 | hide edit button 97 | hide start date 98 | limit 5 99 | ``` 100 | ```` 101 | 102 | ````ad-dashb 103 | title: Recent cases 104 | color: 0, 169, 206 105 | icon: file-contract 106 | ```dataviewjs 107 | function checkDate(item) { 108 | if (moment(new Date(item.lastDate)).isAfter(moment().subtract(2, 'weeks'))){ 109 | return true 110 | } 111 | return false 112 | } 113 | 114 | let customers = dv.pages('"Customers" and #case') 115 | for (let customer of customers){ 116 | customer.lastDate = customer.file.mday 117 | for (let inlink of customer.file.inlinks){ 118 | if(dv.page(inlink).file.tags.indexOf("#meeting") > -1 && dv.page(inlink).file.folder == customer.file.folder){ 119 | if (customer.lastDate < dv.page(inlink).file.mday){ 120 | customer.lastDate = dv.page(inlink).file.mday 121 | } 122 | } 123 | } 124 | } 125 | dv.table(["Logo","Name", "Products","AE", "Last activity"], customers 126 | .filter(t => checkDate(t)) 127 | .sort(k => k.lastDate, "desc") 128 | .map(b => ["![](" + b.logo + ")", "[["+b.file.name+"]]", b.products,b.ae, b.lastDate])) 129 | ``` 130 | ```` -------------------------------------------------------------------------------- /Dashboard.css: -------------------------------------------------------------------------------- 1 | /* Replace backlink with icon */ 2 | 3 | .dashboard .tasks-backlink > .internal-link { 4 | font-size: 0; 5 | } 6 | 7 | .dashboard .tasks-backlink > .internal-link:after { 8 | content: " 📑"; 9 | font-size: 14px; 10 | } 11 | 12 | .dashboard .tasks-list-text > a { 13 | pointer-events: none; 14 | cursor: default; 15 | color: inherit !important; /* blue colors for links too */ 16 | text-decoration: inherit; /* no underline */ 17 | font-weight: inherit; 18 | } 19 | 20 | .dashboard .tasks-list-text .external-link { 21 | background-image: none; 22 | padding-right: 0px; 23 | } 24 | 25 | .dashboard .multiColumnParent { 26 | background: rgb(224, 211, 211); 27 | } 28 | 29 | /* Add line between tasks */ 30 | 31 | .dashboard .plugin-tasks-list-item { 32 | padding: 0.1em 0; 33 | border-bottom: 1px solid #ccc; 34 | } 35 | 36 | /* .dashboard { 37 | --line-width-adaptive: none 38 | } */ 39 | 40 | /* Below taken from here: https://forum.obsidian.md/t/dashboard-a-simple-organization-and-navigation-method-for-obsidian-vaults/33197/6 and modified */ 41 | 42 | .dashboard { 43 | padding-left: 25px !important; 44 | padding-right: 25px !important; 45 | padding-top: 20px !important; 46 | } 47 | 48 | .dashboard .markdown-preview-section { 49 | max-width: 100%; 50 | } 51 | 52 | /* Title at top of the document */ 53 | .dashboard .markdown-preview-section .title { 54 | top: 60px; 55 | position: absolute; 56 | font-size: 26pt !important; 57 | font-weight: bolder; 58 | letter-spacing: 8px; 59 | } 60 | 61 | .dashboard h1 { 62 | border-bottom-style: dotted !important; 63 | border-width: 1px !important; 64 | padding-bottom: 3px !important; 65 | } 66 | 67 | .dashboard div > ul:not(.plugin-tasks-query-result):not(.list-view-ul) { 68 | list-style: none; 69 | display: flex; 70 | column-gap: 50px; 71 | row-gap: 30px; 72 | flex-flow: row; 73 | /* flex-flow: row wrap; */ 74 | } 75 | 76 | .dashboard .admonition-content li > h2 { 77 | white-space: nowrap; 78 | } 79 | 80 | .admonition-content-holder > .admonition-content { 81 | margin: 0; 82 | } 83 | 84 | .admonition-content-holder > .admonition-content ul { 85 | padding-inline-start: 25px; 86 | } 87 | -------------------------------------------------------------------------------- /Dataview.css: -------------------------------------------------------------------------------- 1 | .table-view-table tr { 2 | border-bottom: 1px dashed; 3 | } 4 | -------------------------------------------------------------------------------- /FinishMeeting.js: -------------------------------------------------------------------------------- 1 | module.exports = async function moveFilesWithTag(params) { 2 | const { app } = params; 3 | 4 | // Get file 5 | const activeFile = this.app.workspace.getActiveFile(); 6 | 7 | // Update meeting status 8 | 9 | let tags = await app.plugins.plugins["metaedit"].api.getPropertyValue( 10 | "tags", 11 | activeFile 12 | ); 13 | 14 | let udpatedTags = tags.replace("future", "held"); 15 | 16 | let outcome = await app.plugins.plugins["metaedit"].api.update( 17 | "tags", 18 | udpatedTags, 19 | activeFile 20 | ); 21 | 22 | // Get customer name and move to its folder 23 | let customerLink = await app.plugins.plugins["metaedit"].api.getPropertyValue( 24 | "Project", 25 | activeFile 26 | ); 27 | 28 | let pureCustomerName = customerLink.match(/\[\[(.*?)\]\]/)[1]; 29 | 30 | await app.fileManager.renameFile( 31 | activeFile, 32 | "Customers/" + pureCustomerName + "/" + activeFile.name 33 | ); 34 | }; 35 | -------------------------------------------------------------------------------- /New case template: -------------------------------------------------------------------------------- 1 | --- 2 | tags: case, 3 | logo: file:///C:/< YOUR PATH HERE! >/Logos/<% tp.file.title.replaceAll(" ", "%20") %>.png 4 | --- 5 | #### General 6 | - AE:: 7 | - CRM 8 | - Products:: 9 | 10 | #### Info 11 | - ERPs:: 12 | 13 | #### Todos 14 | ```tasks 15 | not done 16 | path includes <% tp.file.title %> 17 | hide task count 18 | hide start date 19 | ``` 20 | 21 | #### Activities 22 | - [[<% tp.date.now("YYYY-MM-DD") %>]] 23 | - [ ] Add to [CRM](https://mycorporatecrm.com/list) ⏳ <% tp.date.now("YYYY-MM-DD", 14) %> 24 | - [ ] Add [logo](https://www.google.com/search?q=logo+fileformat:png&tbm=isch) ⏳ <% tp.date.now("YYYY-MM-DD", 14) %> 25 | 26 | #### Meetings 27 | ```dataviewjs 28 | let meetings = dv.pages(`"${dv.current().file.folder}" and #meeting`) 29 | meetings = meetings.sort(k => k.date, 'desc') 30 | for (let meeting of meetings){ 31 | dv.el("p", "![[" + meeting.file.name + "]]"); 32 | } 33 | ``` -------------------------------------------------------------------------------- /New meeting template for QuickAdd: -------------------------------------------------------------------------------- 1 | --- 2 | tags: meeting, future 3 | --- 4 | ```button 5 | name Finish Meeting 6 | type command 7 | action QuickAdd: FinishMeeting 8 | color yellow 9 | remove true 10 | ``` 11 | ^button-y9qv 12 | #### Metadata 13 | Project:: [[{{VALUE:PROJECT}}]] 14 | Date:: [[{{VALUE:DATE}}]] 15 | 16 | # Preparation 17 | - [ ] Prepare for meeting 📅 {{VALUE:TODODATE}} 18 | 19 | # Agenda & files 20 | - 21 | 22 | # Attendees 23 | - 24 | 25 | # Notes 26 | - 27 | -------------------------------------------------------------------------------- /SetupNewCustomer.js: -------------------------------------------------------------------------------- 1 | module.exports = async function setupNewCustomer(params) { 2 | const { app } = params; 3 | 4 | // Get file 5 | const activeFile = this.app.workspace.getActiveFile(); 6 | 7 | // Create folders 8 | const fileName = activeFile.basename; 9 | 10 | await app.vault.createFolder("Customers/" + fileName); 11 | await app.vault.createFolder("Customers/" + fileName + "/Files"); 12 | 13 | // Move note 14 | 15 | await app.fileManager.renameFile( 16 | activeFile, 17 | "Customers/" + fileName + "/" + activeFile.name 18 | ); 19 | 20 | // Search for logo 21 | const custonerURLName = fileName.replace(" ", "%20"); 22 | window.open( 23 | "https://www.google.com/search?q=png+logo+" + custonerURLName + "&tbm=isch", 24 | "_blank" 25 | ); 26 | }; 27 | -------------------------------------------------------------------------------- /Use full length for note.css: -------------------------------------------------------------------------------- 1 | .maxWidth.markdown-preview-view.is-readable-line-width .markdown-preview-sizer { 2 | width: 100% !important; 3 | max-width: 100% !important; 4 | } 5 | 6 | .dashboard .markdown-preview-section { 7 | width: 100% !important; 8 | max-width: 100% !important; 9 | } 10 | -------------------------------------------------------------------------------- /VaultToShare.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gnopps/ObsidianScripts/ef02883ec3b2035a52249c998a8700eaeb00e70b/VaultToShare.zip --------------------------------------------------------------------------------