forked from Gnopps/ObsidianScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCRM_Macro.js
More file actions
23 lines (23 loc) · 781 Bytes
/
CRM_Macro.js
File metadata and controls
23 lines (23 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// You have to export the function you wish to run.
// QuickAdd automatically passes a parameter, which is an object with the Obsidian app object
// and the QuickAdd API (see description further on this page).
module.exports = async (params) => {
// Object destructuring. We pull inputPrompt out of the QuickAdd API in params.
const {
quickAddApi: { executeChoice },
} = params;
const pickedFile = await params.quickAddApi.suggester(
(file) => file.basename,
params.app.vault.getMarkdownFiles()
);
let TAG = "";
if (pickedFile.basename === "MYCOMPANY") { // Change to your company
TAG = "Colleague";
} else {
TAG = "Customer";
}
await params.quickAddApi.executeChoice("PasteInfo", {
EMPLOYER: pickedFile.basename,
TAG: TAG,
});
};