Open OsoRojo opened 6 months ago
I'm unable to use ${originalname} in conjunction with any other format parameters. In fact it seems to just not work at all.
Looks like the ${date}
was not working right. Can you provide your setting (a data.json file in .obsidian/plugins/attachment-management
) of this plugin?
I have tested your example, it's work.
Additionally, originalname doesn't appear to be supported in extension overrides
I have forgot to update the description, your can also use ${originalname}
in overrides.
See attached. I just removed the plugin and reinstalled, and I'm getting the same result. Extension overrides that include date as noted above just result with the original filename (which is good) and a '-1' at the end instead of the filename (which is bad).
Also, as previously noted using originalname either isn't working, OR it cannot be combined with other options. I just tested that again in the base settings (not an extension override) and it moves the file fine, but no renaming occurs. Use case: ${originalname} - ${date}
I should have noted, this is occurring when I'm running the rearrange attachments command, NOT on attachment insertion (paste). I just noticed that the combination of ${originalname} - ${date}
does appear to work when pasting in images, but not when running the rearrange attachments command.
The variable ${originalname}
has a flaw, since I have not presist the origianl name of an attachment when it was added to notes. When you add an attachment to ob, we could simply know the name of the attachment. But in the rename (rearrange) operation, this plugin didn't know the origanl name and just return current name (ignore all variable). The suffix -1
was added for deduplicate.
I will make a PR to complete the implemention of ${originalname}
. You can temporarily disable this plugin if other variable was not meet your needs.
It seems to me in this case that using the current name as the original name would probably make the most sense. At least, that's the behavior I was sort of expecting. Glad that the additional context (rearrange vs. new insertion) helped to sort it out!
Loving the plugin so far. Just trying to find the best way to leverage it!
Thanks!
I'm unable to use ${originalname} in conjunction with any other format parameters. In fact it seems to just not work at all.
Example:
Image file named "foo.jpg" Attachment format of: ${originalname} - ${date} Result: foo-1.jpg
Additionally, originalname doesn't appear to be supported in extension overrides, which is where I really need them the most. At least the dialog doesn't list it as an option, and it definitely doesn't work. I don't know if this is intended or an oversight.