{"record":{"id":"90a06235e525fe9b","repo":"siyuan-note/siyuan","slug":"the-shorthand-save-notebook-is-unavailable-select-an-opened","errorCode":null,"errorMessage":"The shorthand save notebook is unavailable. Select an opened non-encrypted notebook in Settings - Document","messagePattern":"The shorthand save notebook is unavailable\\. Select an opened non-encrypted notebook in Settings - Document","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/shortcuts.go","lineNumber":58,"sourceCode":"\nfunc MoveLocalShorthands(boxID string) (retIDs []string, err error) {\n\tshorthandsDir := filepath.Join(util.ShortcutsPath, \"shorthands\")\n\tif !gulu.File.IsDir(shorthandsDir) {\n\t\treturn\n\t}\n\tif !syncLock.TryLock() {\n\t\terr = errors.New(Conf.Language(222))\n\t\treturn\n\t}\n\tdefer syncLock.Unlock()\n\n\tentries, err := os.ReadDir(shorthandsDir)\n\tif nil != err {\n\t\tlogging.LogErrorf(\"read dir [%s] failed: %s\", shorthandsDir, err)\n\t\treturn\n\t}\n\tif !IsShorthandSaveBoxAvailable(boxID) {\n\t\terr = errors.New(Conf.Language(375))\n\t\treturn\n\t}\n\n\tassetsDir := filepath.Join(util.DataDir, \"assets\")\n\tfor _, entry := range entries {\n\t\tif entry.IsDir() && \"assets\" == entry.Name() {\n\t\t\tassetsEntries, readErr := os.ReadDir(filepath.Join(shorthandsDir, entry.Name()))\n\t\t\tif nil != readErr {\n\t\t\t\tlogging.LogErrorf(\"read dir [%s] failed: %s\", shorthandsDir, readErr)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, assetEntry := range assetsEntries {\n\t\t\t\tif assetEntry.IsDir() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tp := filepath.Join(shorthandsDir, entry.Name(), assetEntry.Name())\n\t\t\t\tassetWritePath := filepath.Join(assetsDir, assetEntry.Name())","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/shortcuts.go#L40-L76","documentation":"MoveLocalShorthands requires a valid target notebook for shorthand documents. If IsShorthandSaveBoxAvailable(boxID) reports false — the box is nil, not opened, or encrypted — the function returns i18n message 375 instructing the user to select an opened non-encrypted notebook in the document settings.","triggerScenarios":"Calling MoveLocalShorthands with a boxID that is not currently open, does not exist, or points to an encrypted notebook while the shorthand save notebook setting is unavailable.","commonSituations":"The configured shorthand save notebook was closed, deleted, or switched to encrypted; config points at a notebook ID from another workspace; fresh install where the shorthand save notebook was never chosen.","solutions":["Open the target notebook or select another one in Settings - Document as the shorthand save notebook","Choose a non-encrypted notebook, since encrypted notebooks are rejected as shorthand targets","Update the shorthand save box configuration to a valid, opened notebook ID before moving"],"exampleFix":"// before\nmodel.MoveLocalShorthands(closedOrEncryptedBoxID)\n// after\nif model.IsShorthandSaveBoxAvailable(boxID) {\n    model.MoveLocalShorthands(boxID)\n}","handlingStrategy":"validation","validationCode":"const boxes = await api.getNotebooks()\nconst box = boxes.find(b => b.id === boxID && !b.closed)\nif (!box) throw new Error('shorthand save box unavailable; select an opened non-encrypted notebook')","typeGuard":"function isOpenBox(b) { return b != null && !!b.id && b.closed === false }","tryCatchPattern":"try { await api.moveLocalShorthands(boxID) } catch (e) { if (String(e).includes('shorthand save notebook')) { openSettingsDocument(); } else throw e }","preventionTips":["Keep the shorthand save notebook open and unencrypted in Settings - Document","Re-validate the configured box ID on workspace changes or restores","Handle encrypted notebooks explicitly: pick a different target for shorthands"],"tags":["config","notebook","encrypted-notebook","siyuan"],"backgroundTag":"invalid-config-value","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}