Skip to content

Misc API ​

Provides system path queries and native foobar2000 host UI commands.

misc ​

misc.exit ​

Ask foobar2000 to exit.

This method takes no parameters.

Returns

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('misc.exit');

misc.getComponentPath ​

Report the directory the component DLL was loaded from.

This method takes no parameters.

Returns

FieldTypeDescription
pathstringThe directory, as a native path.
valuestringThe same directory; kept for themes that read value.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('misc.getComponentPath');

misc.getFoobarPath ​

Report the foobar2000 installation directory.

This method takes no parameters.

Returns

FieldTypeDescription
pathstringThe directory, as a native path.
valuestringThe same directory; kept for themes that read value.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('misc.getFoobarPath');

misc.getProfilePath ​

Report the foobar2000 profile directory, where configuration and components live.

This method takes no parameters.

Returns

FieldTypeDescription
pathstringThe directory, as a native path.
valuestringThe same directory; kept for themes that read value.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('misc.getProfilePath');

misc.restart ​

Ask foobar2000 to restart.

This method takes no parameters.

Returns

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('misc.restart');

misc.showConsole ​

Open the foobar2000 console window.

This method takes no parameters.

Returns

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('misc.showConsole');

misc.showLibrarySearch ​

Open the media library search window, optionally with a query filled in.

ParameterTypeRequiredDescription
querystringNoQuery filled into the search box; empty opens a blank search. Default: "".

Returns

FieldTypeDescription
querystringThe query the window opened with.

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
await fb2k.invoke('misc.showLibrarySearch', { query: 'artist has Radiohead' });

misc.showPopupMessage ​

Show a foobar2000 popup message dialog. The call returns when the dialog is shown, not when it is closed.

ParameterTypeRequiredDescription
messagestringYesBody text of the dialog. Must not be empty.
titlestringNoTitle bar text. Default: "Message".

Returns

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
await fb2k.invoke('misc.showPopupMessage', {
    message: 'Playlist exported.',
    title: 'Now Playing',
});

misc.showPreferences ​

Open the foobar2000 Preferences dialog.

This method takes no parameters.

Returns

success is true on success. On failure the response is { success: false, error, code }; see Error codes for code.

js
const result = await fb2k.invoke('misc.showPreferences');

Owner-family behavior and limits ​

  • misc.showPopupMessage requires a non-empty message and defaults title to "Message"; a call that still sends msg is refused with INVALID_PARAMS (unknown parameter 'msg'). misc.showConsole, misc.showPreferences, misc.restart and misc.exit run the corresponding foobar2000 standard command and fail with OPERATION_FAILED when foobar2000 declines to run it.

Contract supplements ​

The sections below close public-contract findings from the strict parameter audit without replacing existing explanations.

Contract supplement: misc.showPopupMessage ​

ParameterTypeRequiredDefaultDescription
messagestringYes—Message body; must not be empty.
titlestringNoMessageDialog title.

Return fields ​

FieldTypeOptional
successbooleanNo

Semantics: an omitted title uses the handler default. A missing or empty message is refused with INVALID_PARAMS (message is required); a call that sends msg is refused as an unknown parameter. Otherwise the dialog is shown and the call reports success: true without waiting for it to close.

js
await fb2k.invoke('misc.showPopupMessage', { message: 'Export finished.' });