You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When trying to store and manage all the images, the attachments are too many to be find as all the images are stored in the same folder. So I've been wanted the plugin to save the images seperately in different folders by document with the imageNameKey given as a parent folder name. But the plugin keeps saying folder not found.
Describe the solution you'd like
Maybe try to create folders before trying to call move.
@@ -159,6 +160,9 @@ export default class PasteImageRenamePlugin extends Plugin {
// file system operation: rename the file
const newPath = path.join(file.parent.path, newName)
try {
+ const newBase = newPath.slice(0, -(path.basename(newPath).length))+ if (!(await this.app.vault.adapter.exists(newBase, true)))+ await this.app.vault.createFolder(newBase)
await this.app.fileManager.renameFile(file, newPath)
} catch (err) {
new Notice(`Failed to rename ${newName}: ${err}`)
Describe alternatives you've considered
Not found yet.
Additional context
None
The text was updated successfully, but these errors were encountered:
May I ask if the problem has been resolved? I am in a lot of pain now
Can I save the images to the specified folder now? If the folder does not exist, it can still be created without prompting that there is no file or directory available
Is your feature request related to a problem? Please describe.
When trying to store and manage all the images, the attachments are too many to be find as all the images are stored in the same folder. So I've been wanted the plugin to save the images seperately in different folders by document with the imageNameKey given as a parent folder name. But the plugin keeps saying folder not found.
Describe the solution you'd like
Maybe try to create folders before trying to call move.
Describe alternatives you've considered
Not found yet.
Additional context
None
The text was updated successfully, but these errors were encountered: