diff --git a/packages/app-desktop/gui/MainScreen/commands/exportPdf.ts b/packages/app-desktop/gui/MainScreen/commands/exportPdf.ts index d7bfe1bd7..3b9987f55 100644 --- a/packages/app-desktop/gui/MainScreen/commands/exportPdf.ts +++ b/packages/app-desktop/gui/MainScreen/commands/exportPdf.ts @@ -3,7 +3,7 @@ import shim from '@joplin/lib/shim'; import InteropServiceHelper from '../../../InteropServiceHelper'; import { _ } from '@joplin/lib/locale'; import Note from '@joplin/lib/models/Note'; -const bridge = require('@electron/remote').require('./bridge').default; +import bridge from '../../../services/bridge'; export const declaration: CommandDeclaration = { name: 'exportPdf', @@ -31,6 +31,14 @@ export const runtime = (comp: any): CommandRuntime => { }); } + if (Array.isArray(path)) { + if (path.length > 1) { + throw new Error('Only one output directory can be selected'); + } + + path = path[0]; + } + if (!path) return; for (let i = 0; i < noteIds.length; i++) {