forked from Gnopps/ObsidianScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinishMeeting.js
More file actions
34 lines (26 loc) · 810 Bytes
/
FinishMeeting.js
File metadata and controls
34 lines (26 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
module.exports = async function moveFilesWithTag(params) {
const { app } = params;
// Get file
const activeFile = this.app.workspace.getActiveFile();
// Update meeting status
let tags = await app.plugins.plugins["metaedit"].api.getPropertyValue(
"tags",
activeFile
);
let udpatedTags = tags.replace("future", "held");
let outcome = await app.plugins.plugins["metaedit"].api.update(
"tags",
udpatedTags,
activeFile
);
// Get customer name and move to its folder
let customerLink = await app.plugins.plugins["metaedit"].api.getPropertyValue(
"Project",
activeFile
);
let pureCustomerName = customerLink.match(/\[\[(.*?)\]\]/)[1];
await app.fileManager.renameFile(
activeFile,
"Customers/" + pureCustomerName + "/" + activeFile.name
);
};