MCPcopy Create free account
hub / github.com/chhoumann/quickadd / noteScriptError

Function noteScriptError

src/gui/MacroGUIs/scriptCandidates.ts:80–88  ·  view source on GitHub ↗
(
	app: App,
	file: TFile,
)

Source from the content-addressed store, hash-verified

78 * note has a runnable ```js fence.
79 */
80export async function noteScriptError(
81 app: App,
82 file: TFile,
83): Promise<string | null> {
84 const content = await app.vault.read(file);
85 const { code, error } = extractScriptFromMarkdown(content);
86 if (code !== null && code.length > 0) return null;
87 return error ?? "No ```js code block found in the note.";
88}
89
90/** Suggester label: basename for .js (legacy), full path for notes. */
91export function candidateLabel(candidate: ScriptCandidate): string {

Callers 4

showScriptPickerMethod · 0.90

Calls 1

Tested by

no test coverage detected