How to apply methods on certain file types only

Advanced Renamer forum
#1 : 25/10-20 16:00
vletroye
vletroye
Posts: 7
Hi,

I am using Advanced Renamer to rename my photos and videos based, respectively, on the following tags:
<Img Year>-<Img Month>-<Img Day> <Img Hour>-<Img Min>-<Img Sec>
and
<Video Date Year>-<Video Date Month>-<Video Date Day> <Video Date Hour>-<Video Date Min>-<Video Date Sec>

As I am lazy, I use both methods in a single list and renamed files and video all togethers.
It works, but errors are always displayed for pictures (which don't have video information).

See https://i.imgur.com/neV9rkb.png

I am wondering if there is a "clean" way to achieve this (in one single list) ?
E.g.: apply methods only of files of a certain type/with a certain extension

Here are the details of my List:

[methods]
method0000=methodname:"newcase"; active:"1"; casetype:"lowercase"; applyto:"extension"; regularexpressions:"0";
method0001=methodname:"newname"; active:"1"; mask:"<Img Year>-<Img Month>-<Img Day> <Img Hour>-<Img Min>-<Img Sec> - # - <IncNr:1>"; tagpage:"5"; applyto:"name";
method0002=methodname:"replace"; active:"1"; replace:"-- --"; replacewith:"<Video Date Year>-<Video Date Month>-<Video Date Day> <Video Date Hour>-<Video Date Min>-<Video Date Sec> - # - <IncNr:1>.<ext>"; casesensitive:"0"; regularexpressions:"1"; applyto:"name"; occurrence:"0";
method0003=methodname:"replace"; active:"1"; replace:"#"; replacewith:""; casesensitive:"0"; regularexpressions:"0"; applyto:"name"; occurrence:"0";


25/10-20 16:00
#2 : 25/10-20 23:39
David Lee
David Lee
Posts: 1125
Reply to #1:
It would take far more effort than I am prepared to offer to sort out your renaming methods from the .aren file listing and the almost illegible image in your link. (I'm only a fellow user).

However two options...

1: stop being lazy and deal with the two file types separately - you can drag the entire folder into the list and use a filename mask to selectively import only video or image files.

In principle you should be able to load all your files into the list and then selectively mark only one type or the other by right clicking on the list and selecting Mark->Mark by pattern and using the extension. However this feature is currently broken although a fix has been promised in the next version of the software (v 3.88).

2: Use a script with an IF statement to deal with the two file types separately on the basis of the file extensions. You can then apply the same tags as in your present methods using app.parseTags() (details in the User Guide: www.advancedrenamer.com/user_guide/example_scripting).


25/10-20 23:39 - edited 25/10-20 23:41
#3 : 27/10-20 12:35
vletroye
vletroye
Posts: 7
Reply to #2:
I used to drag&drop the files. Drag&dropping the folder is a great tip. Many thx !

Thx also for the suggestion with the script... I will investigate that option.

On my own, I found that using ExifTool, I can get the original creation date of most media (using various properties) without the error I had when a Video or Photo Tag was not available. Here is the outcome:

[methods]
method0000=methodname:"newname"; active:"1"; mask:"<ExifTool:DateTimeOriginal> - # - <Inc Nr:1>"; tagpage:"0"; applyto:"name";
method0001=methodname:"replace"; active:"1"; replace:" - # -"; replacewith:"<ExifTool:MediaCreateDate> - # -"; casesensitive:"0"; regularexpressions:"0"; applyto:"name"; occurrence:"0";

I am using ExifTool:DateTimeOriginal for the photos and ExifTool:MediaCreateDate for the videos.

V.


27/10-20 12:35