So:Honimoura wrote: ↑October 22nd, 2020, 11:54 am Hello, sorry I didn't answer earlier.
Yes the problem has been solved.
Another problem arose but I didn't have time to deal with it until today.
With the name of a file I created this code to recover its extension:
However for some reason that escapes me, "EXT2" is not equal to one of the extensions (.jpg, .jpeg or .png) but to the name of the entire file ...Code: Select all
[CalculeLNKtoEXTIMG2] Measure=Plugin Plugin=FileView3 Path=[MeasureFolderEXTIMG] Type=FileName Index=2 IfMatch=.*jpg.* IfMatchAction=[!SetOption EXT2 String ".jpg"] IfMatch2=.*jpeg.* IfMatchAction2=[!SetOption EXT2 String ".jpeg"] IfMatch3=.*png.* IfMatchAction3=[!SetOption EXT2 String ".png"] IfMatchMode=1 DynamicVariables=1
- you have a typo (syntax mistake) in the Plugin option of the posted measure, I'll let you figure out what that is
- once you correct the typo, it will most likely work, assuming you don't do other things conflicting with the !SetOption in the EXT2 measure
- that being said, the regex patterns used in the IfMatches are kind of loose, some better ones would be, say, \.jpg$ and such, in order to match the occurence of an ".EXTENSION" pattern at the end of the string (in the pattern, \. is a literal . since it's escaped by the preceding \, and $ means the end of the string)
- it is advisable (but not absolutely required, it depends on your needs) to add an [!UpdateMeasure EXT2], and possibly even a [!UpdateMeter *][!Redraw] bang sequence after each !SetOption bang, in order to speed up the process and update to the new values "right now", as opposed to "on the next update" as it is now
- on top of all that, these IfMatches aren't even needed, since one can get the extension by removing or commenting the said IfMatches and simply use the "built-in" way in the FileView plugin, i.e. the FileType option in the target measure, like:
Code: Select all
[EXT2]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolderEXTIMG]
Type=FileType
Index=2