### Re-import Linked Files into Zotero Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Converts linked file attachments back into Zotero stored attachments. This function removes the 'zotmoov' tag from reimported items and updates any note links referencing the old attachment key. It's useful for bringing files back into Zotero's management, for example, after returning files from a tablet. ```javascript // Re-import linked files (e.g. after returning files from a tablet) const items = Array.from(Zotero.ZotMoov._getSelectedItems()); const results = await Zotero.ZotMoov.moveFrom(items, { add_zotmoov_tag: true, // Remove 'zotmoov' tag from re-imported items tag_str: 'zotmoov', max_io: 1, }); // results: array of new Zotero stored attachment items // The linked file is moved into Zotero's data directory and the link is replaced. ``` -------------------------------- ### Configure File Behavior in ZotMoov Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/SETTINGS_INFO.md Set ZotMoov to either move or copy files. 'Move' is the default and recommended option for most users. 'Copy' creates an external backup but untracks files from Zotero. ```text copy ``` -------------------------------- ### Define and Apply Custom Context Menu Items with ZotMoovCMUParser Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Use ZotMoovCMUParser to define custom context menu item pipelines from JSON. Apply these pipelines to selected Zotero items for multi-step workflows. ```javascript // Custom menu item: "Move to Tablet" – moves files then tags them // JSON stored in extensions.zotmoov.custom_menu_items: const menuJson = { "Move to Tablet": [ { command_name: "move", enable_customdir: true, directory: "/mnt/tablet/Papers", enable_subdir: true, }, { command_name: "add_tag", tag: "on-tablet", do_parent: true, // Also tag the parent item, not just the attachment } ], "Return from Tablet": [ { command_name: "move_from" // Re-import linked files into Zotero storage }, { command_name: "rem_tag", tag: "on-tablet", do_parent: true, } ], "Extract Annotations": [ { command_name: "ann2note" // Convert PDF annotations to a Zotero note } ] }; const menuParser = new ZotMoovCMUParser(menuJson); // Execute the "Move to Tablet" pipeline on selected items const selectedItems = Array.from(Zotero.ZotMoov._getSelectedItems()); const movedItems = await menuParser.apply("Move to Tablet", selectedItems); // Files moved to /mnt/tablet/Papers/... and tagged "on-tablet" in Zotero ``` -------------------------------- ### Set Advanced ZotMoov Preferences Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Configure advanced ZotMoov settings using Zotero.Prefs.set. These preferences offer more granular control over file operations and naming. ```javascript Zotero.Prefs.set('extensions.zotmoov.strip_diacritics', true, true); // Remove accented characters from file/path names ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.copy_overwrite', false, true); // Overwrite existing files in copy mode instead of numbering duplicates ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.max_io_concurrency', 4, true); // Number of concurrent file I/O operations ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.attach_search_dir', '/home/user/Downloads', true); // Folder searched for "Attach New File" feature (last-modified file) ``` -------------------------------- ### Set General ZotMoov Preferences Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Use Zotero.Prefs.set to configure general ZotMoov behavior. These preferences are accessible via the ZotMoov Settings UI. ```javascript Zotero.Prefs.set('extensions.zotmoov.dst_dir', '/home/user/Papers', true); // Base directory for move/copy operations ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.file_behavior', 'move', true); // 'move' (default) or 'copy' ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.enable_automove', true, true); // Automatically move/copy files on import ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.enable_subdir_move', true, true); // Organize into subdirectories using subdirectory_string ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.subdirectory_string', '{%c}/{%a}{-%y}', true); // Wildcard template for subdirectory structure (default: '{%c}') ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.allowed_fileext', JSON.stringify(['pdf', 'epub', 'docx']), true); // File extensions to process; empty array = all extensions ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.delete_files', true, true); // Auto-delete linked files from disk on Zotero item deletion ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.prune_empty_dir', true, true); // Remove empty directories after deleting files ``` -------------------------------- ### Text Wildcard Command Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/CUSTOM_WILDCARD_INFO.md Use the 'text' command to insert custom strings, following the same formatting rules as subdirectory strings in General Settings. ```text text ``` -------------------------------- ### Copy Attachments as External Backup with ZotMoov Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Copies attachments to a specified directory without modifying the Zotero item; the copied file is not tracked by Zotero. Useful for creating backups. Options allow for group library support, overwriting existing files, and organizing backups into subfolders. ```javascript // Copy all attachments to a backup folder, overwriting existing backups const items = Array.from(Zotero.ZotMoov._getSelectedItems()); const results = await Zotero.ZotMoov.copy(items, '/mnt/backup/Papers', { into_subfolder: true, subdir_str: '{%a}/{%y}', // Backup into Author/Year subfolders allowed_file_ext: ['pdf'], allow_group_libraries: true, // Also backup files from group libraries rename_file: true, strip_diacritics: true, // Remove accented chars for cross-OS compatibility copy_overwrite: true, // Overwrite existing backup files max_io: 4, // Run up to 4 concurrent copy operations undefined_str: 'unknown', }); // results: array of original Zotero items that were successfully copied // Files appear at /mnt/backup/Papers/Smith/2022/Smith - Article Title.pdf ``` -------------------------------- ### ZotMoovWildcard.process_string(item, string, options) Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Evaluates a template string containing wildcard and conditional expressions against a Zotero item to return a substituted path string. This is used for organizing files based on item metadata. ```APIDOC ## `ZotMoovWildcard.process_string(item, string, options)` — Process wildcard subdirectory strings Evaluates a template string containing `%`-prefixed wildcards and `{}`-wrapped conditional/OR expressions against a Zotero item, returning the substituted path string. Used to compute the subdirectory path for organizing files. Supports all ZotFile-compatible wildcards plus collection paths, date-added fields, and custom wildcards (`%1`–`%9`). ### Parameters - **item** (Zotero.Item): The Zotero item to process. - **string** (string): The template string containing wildcards and expressions. - **options** (object, optional): Configuration options for processing the string. - **preferred_collection** (string | null, optional): Specifies a preferred collection path to use if multiple collections exist. - **undefined_str** (string, optional): The string to substitute when a wildcard has no value. Defaults to 'undefined'. - **custom_wc** (object, optional): An object defining custom wildcard values (e.g., `%1` to `%9`). ### Request Example ```javascript // Compute the subdirectory string for an item, e.g. for subdir_str = '{%c}/{%a}{-%y}' // Item: author=Smith, year=2021, collection=Biology > Genetics const wildcard = Zotero.ZotMoov.wildcard; const subdir = wildcard.process_string(item, '{%c}/{%a}{-%y}', { preferred_collection: null, // Use first collection if multiple undefined_str: 'undefined', // Substitute when wildcard has no value custom_wc: {}, // Custom wildcard definitions (%1..%9) }); // More complex pattern with OR fallback: journal abbreviation or full name // "{/%s | %j}/{%y}{-%m}" → "/Nature/2021-06" const subdir2 = wildcard.process_string(item, '{/%s | %j}/{%y}{-%m}', { undefined_str: 'misc', }); ``` ### Response - **subdir** (string): The processed path string with wildcards substituted. ### Available Wildcards: - `%a` last name of first author - `%y` publication year - `%F` AuthorLastFirstInitial (DoeJ) - `%t` title (truncated at : . ? !) - `%I` author initials - `%j` journal name - `%A` first letter of author - `%s` journal abbreviation - `%c` collection path (Top/Sub) - `%p` publisher - `%b` BetterBibTeX citation key - `%w` journal or publisher - `%v` volume - `%e` issue - `%f` pages - `%T` localized item type - `%Y` year added - `%M` month added - `%R` day added - `%m` publication month - `%r` publication day - `%U` literal "undefined" (or custom undefined_str) ``` -------------------------------- ### Trim Wildcard Command Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/CUSTOM_WILDCARD_INFO.md Use the 'trim' command to remove leading and trailing whitespace from a string. ```javascript trim ``` -------------------------------- ### Exec Wildcard Command Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/CUSTOM_WILDCARD_INFO.md Use the 'exec' command to execute a search using a regular expression, similar to JavaScript's RegExp.exec(). ```javascript exec ``` -------------------------------- ### To Uppercase Wildcard Command Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/CUSTOM_WILDCARD_INFO.md Use the 'toUpperCase' command to convert a string to uppercase. ```javascript toUpperCase ``` -------------------------------- ### ZotMoov.move(items, dst_path, options) Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Moves Zotero stored attachments to a specified destination path on disk, replacing them with linked file attachments. It updates links in parent item notes and operates on personal libraries by default. ```APIDOC ## ZotMoov.move(items, dst_path, options) — Move attachments to a linked directory ### Description Moves Zotero stored attachments to `dst_path` on disk, replacing each with a linked file attachment. The original Zotero item is erased and replaced with a clone pointing to the new file path. Note links in parent item notes are automatically updated to the new item key. Only operates on the user's personal library (not group libraries) unless the item is already linked. ### Parameters #### Path Parameters - **items** (Array) - Required - An array of Zotero attachment items to move. - **dst_path** (string) - Required - The destination directory path on disk. - **options** (object) - Optional - Configuration options for the move operation. - **ignore_linked** (boolean) - Optional - Skip already-linked files. Defaults to false. - **into_subfolder** (boolean) - Optional - Enable subdirectory organization. Defaults to false. - **subdir_str** (string) - Optional - Wildcard template for subdirectory organization (e.g., '{%c}/{%y}'). - **allowed_file_ext** (Array) - Optional - Array of allowed file extensions (e.g., ['pdf', 'epub']). - **preferred_collection** (string|null) - Optional - Preferred collection for organization. Defaults to auto-detection. - **rename_title** (boolean) - Optional - Update Zotero item title to new filename. Defaults to false. - **rename_file** (boolean) - Optional - Rename file using Zotero's auto-rename rules. Defaults to false. - **add_zotmoov_tag** (boolean) - Optional - Tag processed items with 'zotmoov'. Defaults to false. - **tag_str** (string) - Optional - The tag string to add if `add_zotmoov_tag` is true. Defaults to 'zotmoov'. - **strip_diacritics** (boolean) - Optional - Keep accented characters in paths. Defaults to false. - **undefined_str** (string) - Optional - Fallback string when a wildcard has no value. Defaults to 'undefined'. - **max_io** (number) - Optional - Maximum concurrent file I/O operations. Defaults to 1. ### Request Example ```javascript // Move selected PDFs into ~/Papers/Research, organized by collection subdirectory const items = Array.from(Zotero.ZotMoov._getSelectedItems()); const results = await Zotero.ZotMoov.move(items, '/home/user/Papers/Research', { ignore_linked: true, // Skip already-linked files into_subfolder: true, // Enable subdirectory organization subdir_str: '{%c}/{%y}', // Subfolder: CollectionPath/Year (e.g. "Biology/2023") allowed_file_ext: ['pdf', 'epub'], // Only move PDFs and EPUBs preferred_collection: null, // Auto-detect from active Zotero pane rename_title: true, // Update Zotero item title to new filename rename_file: true, // Rename file using Zotero's auto-rename rules add_zotmoov_tag: true, // Tag processed items with 'zotmoov' tag_str: 'zotmoov', strip_diacritics: false, // Keep accented characters in paths undefined_str: 'undefined', // Fallback string when a wildcard has no value max_io: 1, // Concurrent file I/O operations }); // results: array of cloned Zotero attachment items that were successfully moved // Each file at /home/user/Papers/Research/Biology/2023/AuthorName - Title.pdf ``` ### Response #### Success Response - **results** (Array) - An array of cloned Zotero attachment items that were successfully moved. ``` -------------------------------- ### Define and Apply Custom Wildcards with ZotMoovCWParser Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Use ZotMoovCWParser to define custom wildcard commands from JSON. Apply these pipelines to Zotero items or process strings with custom wildcards. ```javascript // Custom wildcard %1: extract DOI domain from the 'url' field, lowercase // JSON stored in extensions.zotmoov.cwc_commands: const cwcJson = { "%1": [ { command_name: "field", field: "url" }, // Start: raw URL value { command_name: "exec", regex: "https?://([^/]+)", group: 1 }, // Extract domain { command_name: "toLowerCase" }, // Lowercase the result ], "%2": [ { command_name: "text", text: "{%a}" }, // First author last name { command_name: "trim" }, // Remove surrounding whitespace { command_name: "replace", regex: " ", replace: "_", flags: "g" }, // Spaces → underscores ] }; const parser = new ZotMoovCWParser(cwcJson); // Apply %1 pipeline to a Zotero item (item.getField('url') = "https://doi.org/10.1234/abc") const result1 = parser.apply('%1', item); // → "doi.org" const result2 = parser.apply('%2', item); // → "Smith" (if author has no spaces) // Custom wildcards are passed into process_string via the custom_wc option: const subdir = Zotero.ZotMoov.wildcard.process_string(item, '{%1}/{%2}/{%y}', { custom_wc: cwcJson, undefined_str: 'unknown', }); // → "doi.org/Smith/2021" ``` -------------------------------- ### Process Wildcard Subdirectory Strings Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Evaluates a template string containing `%`-prefixed wildcards and `{}`-wrapped conditional/OR expressions against a Zotero item to compute a substituted path string. This is used for organizing files and supports ZotFile-compatible wildcards, collection paths, date-added fields, and custom wildcards. ```javascript // Compute the subdirectory string for an item, e.g. for subdir_str = '{%c}/{%a}{-%y}' // Item: author=Smith, year=2021, collection=Biology > Genetics const wildcard = Zotero.ZotMoov.wildcard; // Result: "Biology/Genetics/Smith-2021" const subdir = wildcard.process_string(item, '{%c}/{%a}{-%y}', { preferred_collection: null, // Use first collection if multiple undefined_str: 'undefined', // Substitute when wildcard has no value custom_wc: {}, // Custom wildcard definitions (%1..%9) }); // More complex pattern with OR fallback: journal abbreviation or full name // "{/%s | %j}" → "Nature" (uses %j if %s is empty) const subdir2 = wildcard.process_string(item, '{/%s | %j}/{%y}{-%m}', { undefined_str: 'misc', }); // → "/Nature/2021-06" or "/Nature Biotechnology/2021" depending on field values // Available wildcards: // %a last name of first author %y publication year // %F AuthorLastFirstInitial (DoeJ) %t title (truncated at : . ? !) // %I author initials %j journal name // %A first letter of author %s journal abbreviation // %c collection path (Top/Sub) %p publisher // %b BetterBibTeX citation key %w journal or publisher // %v volume %e issue %f pages %T localized item type // %Y year added %M month added %R day added // %m publication month %r publication day // %U literal "undefined" (or custom undefined_str) ``` -------------------------------- ### ZotMoov.copy(items, dst_path, options) Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Copies attachments to a specified destination path without modifying the original Zotero item. The copied file is not tracked by Zotero. Supports group libraries and overwriting existing files. ```APIDOC ## ZotMoov.copy(items, dst_path, options) — Copy attachments as external backup ### Description Copies attachments to `dst_path` without modifying the Zotero item. The copied file is **not** tracked by Zotero. Supports group libraries (via `allow_group_libraries`). When `copy_overwrite` is true, existing files are overwritten rather than creating numbered duplicates. ### Parameters #### Path Parameters - **items** (Array) - Required - An array of Zotero attachment items to copy. - **dst_path** (string) - Required - The destination directory path on disk. - **options** (object) - Optional - Configuration options for the copy operation. - **into_subfolder** (boolean) - Optional - Enable subdirectory organization. Defaults to false. - **subdir_str** (string) - Optional - Wildcard template for subdirectory organization (e.g., '{%a}/{%y}'). - **allowed_file_ext** (Array) - Optional - Array of allowed file extensions (e.g., ['pdf']). - **allow_group_libraries** (boolean) - Optional - Also backup files from group libraries. Defaults to false. - **rename_file** (boolean) - Optional - Rename file using Zotero's auto-rename rules. Defaults to false. - **strip_diacritics** (boolean) - Optional - Remove accented characters for cross-OS compatibility. Defaults to false. - **copy_overwrite** (boolean) - Optional - Overwrite existing backup files. Defaults to false. - **max_io** (number) - Optional - Maximum concurrent file I/O operations. Defaults to 1. - **undefined_str** (string) - Optional - Fallback string when a wildcard has no value. Defaults to 'undefined'. ### Request Example ```javascript // Copy all attachments to a backup folder, overwriting existing backups const items = Array.from(Zotero.ZotMoov._getSelectedItems()); const results = await Zotero.ZotMoov.copy(items, '/mnt/backup/Papers', { into_subfolder: true, subdir_str: '{%a}/{%y}', // Backup into Author/Year subfolders allowed_file_ext: ['pdf'], allow_group_libraries: true, // Also backup files from group libraries rename_file: true, strip_diacritics: true, // Remove accented chars for cross-OS compatibility copy_overwrite: true, // Overwrite existing backup files max_io: 4, // Run up to 4 concurrent copy operations undefined_str: 'unknown', }); // results: array of original Zotero items that were successfully copied // Files appear at /mnt/backup/Papers/Smith/2022/Smith - Article Title.pdf ``` ### Response #### Success Response - **results** (Array) - An array of original Zotero items that were successfully copied. ``` -------------------------------- ### ZotMoov.moveFrom(items, options) Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Converts linked file attachments back into Zotero stored attachments. It removes the 'zotmoov' tag from reimported items and updates any note links referencing the old attachment key. ```APIDOC ## `ZotMoov.moveFrom(items, options)` — Import linked files back into Zotero Converts linked file attachments back into Zotero stored attachments by calling Zotero's internal `convertLinkedFileToStoredFile`. Removes the `zotmoov` tag from reimported items and updates any note links referencing the old attachment key. ### Parameters - **items** (Array): An array of Zotero item objects whose linked files should be converted to stored attachments. - **options** (object, optional): Configuration options for the import process. - **add_zotmoov_tag** (boolean, optional): If true, the 'zotmoov' tag will be removed from re-imported items. Defaults to true. - **tag_str** (string, optional): The tag string to manage. Used in conjunction with `add_zotmoov_tag`. - **max_io** (number, optional): Maximum number of I/O operations to perform concurrently. ### Request Example ```javascript // Re-import linked files (e.g. after returning files from a tablet) const items = Array.from(Zotero.ZotMoov._getSelectedItems()); const results = await Zotero.ZotMoov.moveFrom(items, { add_zotmoov_tag: true, // Remove 'zotmoov' tag from re-imported items tag_str: 'zotmoov', max_io: 1, }); // results: array of new Zotero stored attachment items ``` ### Response - **results** (Array): An array of newly created Zotero stored attachment items. ``` -------------------------------- ### Move Attachments to Linked Directory with ZotMoov Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Moves Zotero stored attachments to a specified directory on disk, replacing each with a linked file attachment. Use this to manage external file storage. Options control subdirectory organization, file extensions, renaming, and tagging. ```javascript // Move selected PDFs into ~/Papers/Research, organized by collection subdirectory const items = Array.from(Zotero.ZotMoov._getSelectedItems()); const results = await Zotero.ZotMoov.move(items, '/home/user/Papers/Research', { ignore_linked: true, // Skip already-linked files into_subfolder: true, // Enable subdirectory organization subdir_str: '{%c}/{%y}', // Subfolder: CollectionPath/Year (e.g. "Biology/2023") allowed_file_ext: ['pdf', 'epub'], // Only move PDFs and EPUBs preferred_collection: null, // Auto-detect from active Zotero pane rename_title: true, // Update Zotero item title to new filename rename_file: true, // Rename file using Zotero's auto-rename rules add_zotmoov_tag: true, // Tag processed items with 'zotmoov' tag_str: 'zotmoov', strip_diacritics: false, // Keep accented characters in paths undefined_str: 'undefined', // Fallback string when a wildcard has no value max_io: 1, // Concurrent file I/O operations }); // results: array of cloned Zotero attachment items that were successfully moved // Each file at /home/user/Papers/Research/Biology/2023/AuthorName - Title.pdf ``` -------------------------------- ### To Lowercase Wildcard Command Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/CUSTOM_WILDCARD_INFO.md Use the 'toLowerCase' command to convert a string to lowercase. ```javascript toLowerCase ``` -------------------------------- ### Field Wildcard Command Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/CUSTOM_WILDCARD_INFO.md Use the 'field' command to retrieve data from Zotero fields. Refer to the Zotero JavaScript API documentation for a list of available fields. ```field field ``` -------------------------------- ### Replace Wildcard Command Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/CUSTOM_WILDCARD_INFO.md Use the 'replace' command to replace a regex pattern with a specified string, utilizing JavaScript's String.replace(). ```javascript replace ``` -------------------------------- ### ZotMoov.delete(items, home_path, options) Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Permanently deletes the on-disk files for linked file attachments within a specified directory. It checks for duplicate references in the database and can optionally prune empty subdirectories. ```APIDOC ## `ZotMoov.delete(items, home_path, options)` — Delete linked files from disk Permanently deletes the on-disk files for linked file attachments that reside within `home_path`. Checks the database for duplicate references before deleting. Optionally prunes empty subdirectories up to (but not including) `home_path`, ignoring OS metadata files (`.DS_Store`, `Thumbs.db`, `desktop.ini`). ### Parameters - **items** (Array): An array of Zotero item objects for which to delete linked files. - **home_path** (string): The base directory path within which to look for linked files to delete. - **options** (object, optional): Configuration options for the deletion process. - **prune_empty_dir** (boolean, optional): If true, empty subdirectories up to `home_path` will be removed. - **max_io** (number, optional): Maximum number of I/O operations to perform concurrently. ### Request Example ```javascript // Delete linked files in the ZotMoov directory when triggered by Zotero item deletion const itemsToDelete = Zotero.Items.get([1234, 5678]); // Zotero item IDs await Zotero.ZotMoov.delete(itemsToDelete, '/home/user/Papers/Research', { prune_empty_dir: true, // Remove empty folders up to the home path max_io: 1, }); ``` ### Response This method does not return a value but performs file system operations. ``` -------------------------------- ### Manage Automatic Item Processing with ZotMoovNotifyCallback Source: https://context7.com/wileyyugioh/zotmoov/llms.txt ZotMoovNotifyCallback automatically processes items on import/modification after a delay. Control auto-processing and ignore specific item keys. ```javascript // The notify callback is registered automatically during plugin startup. // Internally, when a new item is imported into Zotero: // 1. addCallback() enqueues the item ID // 2. A debounced timer fires _execute() after auto_process_delay ms // 3. _execute() waits for any active sync to finish, then calls ZotMoov.move/copy // To temporarily prevent auto-processing of specific items (e.g. during a manual move): Zotero.ZotMoov.notifyCallback.addKeysToIgnore(['ABCD1234', 'EFGH5678']); // These item keys will be skipped in the next processing batch. // Auto-move is controlled by the preference: Zotero.Prefs.set('extensions.zotmoov.enable_automove', true, true); // Enable Zotero.Prefs.set('extensions.zotmoov.auto_process_delay', 3000, true); // 3s delay // Manually trigger a destroy/cleanup (called on plugin shutdown): Zotero.ZotMoov.notifyCallback.destroy(); // Clears pending timers and re-enables any paused Zotero sync. ``` -------------------------------- ### Delete Linked Files with ZotMoov Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Permanently deletes on-disk files for linked attachments. It checks for duplicate references in the database and can optionally prune empty subdirectories. Use this when Zotero items are deleted and their associated files should also be removed. ```javascript // Delete linked files in the ZotMoov directory when triggered by Zotero item deletion // (Called internally by the notify callback when extensions.zotmoov.delete_files is true) const itemsToDelete = Zotero.Items.get([1234, 5678]); // Zotero item IDs await Zotero.ZotMoov.delete(itemsToDelete, '/home/user/Papers/Research', { prune_empty_dir: true, // Remove empty folders up to the home path max_io: 1, }); // Files at paths within /home/user/Papers/Research are removed from disk. // Empty subdirectories (e.g. /home/user/Papers/Research/Biology/2020/) are also removed. ``` -------------------------------- ### ZotMoov Hidden Preferences Configuration Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/SETTINGS_INFO.md Modify ZotMoov's behavior by adjusting hidden preferences in Zotero's advanced settings. These preferences control features like custom title renaming, undefined string handling, tag addition, and menu item visibility. ```text extensions.zotmoov.rename_title ``` ```text extensions.zotmoov.undefined_str ``` ```text extensions.zotmoov.add_zotmoov_tag ``` -------------------------------- ### Set Hidden ZotMoov Preferences Source: https://context7.com/wileyyugioh/zotmoov/llms.txt Modify hidden ZotMoov preferences using Zotero.Prefs.set for advanced or less commonly used features. Access these via Zotero's hidden preferences editor (about:config). ```javascript Zotero.Prefs.set('extensions.zotmoov.rename_title', true, true); // Update Zotero item title to match new filename after move ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.undefined_str', 'misc', true); // String substituted for %U wildcard (default: 'undefined') ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.add_zotmoov_tag', true, true); // Tag moved items with tag_str ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.tag_str', 'zotmoov', true); // Tag name applied to processed items ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.menu_items.move.hidden', false, true); ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.menu_items.convert_linked.hidden', false, true); ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.menu_items.custom_move.hidden', false, true); // Hide/show default ZotMoov context menu items ``` ```javascript Zotero.Prefs.set('extensions.zotmoov.no_rename_file', false, true); // Disable Zotero's auto-rename on the physical file during move ``` -------------------------------- ### Hide Default ZotMoov Menu Items Source: https://github.com/wileyyugioh/zotmoov/blob/master/docs/SETTINGS_INFO.md Control the visibility of default menu items in ZotMoov. These preferences allow you to hide specific actions like 'move', 'convert linked', 'custom move', and 'fix note links'. ```text extensions.zotmoov.menu_items.move.hidden extensions.zotmoov.menu_items.convert_linked.hidden extensions.zotmoov.menu_items.custom_move.hidden ``` ```text extensions.zotmoov.menu_items.fix_note_links.hidden ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.