MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / copyBasesCurrentViewTasks

Function copyBasesCurrentViewTasks

src/bases/basesTaskCopyActions.ts:56–81  ·  view source on GitHub ↗
({
	dataItems,
	format,
	identifyTaskNotes,
	filterTasks,
	resolveLinkText,
	writeText,
}: CopyBasesCurrentViewTasksOptions)

Source from the content-addressed store, hash-verified

54}
55
56export async function copyBasesCurrentViewTasks({
57 dataItems,
58 format,
59 identifyTaskNotes,
60 filterTasks,
61 resolveLinkText,
62 writeText,
63}: CopyBasesCurrentViewTasksOptions): Promise<CopyBasesCurrentViewTasksResult> {
64 const taskNotes = await identifyTaskNotes(dataItems);
65 const filteredTasks = filterTasks(taskNotes);
66 const clipboardTasks = filteredTasks.map((task) => ({
67 path: task.path,
68 title: task.title,
69 }));
70
71 if (clipboardTasks.length === 0) {
72 return { status: "empty" };
73 }
74
75 const text = formatTasksForClipboard(clipboardTasks, format, resolveLinkText);
76 await writeText(text);
77 return {
78 status: "copied",
79 count: clipboardTasks.length,
80 };
81}
82
83export function resolveBasesTaskLinkText(app: App, path: string): string {
84 const file = app.vault.getAbstractFileByPath(path);

Callers 2

copyCurrentViewTasksFunction · 0.90

Calls 1

formatTasksForClipboardFunction · 0.90

Tested by

no test coverage detected