#1 2021-06-22 14:28

Lauraq
Member
Registered: 2016-10-02
Posts: 78

execute script only with certain extension

Hi smile
Is possible execute script only with certain extension?
I would like a script that acts only on .flac files and leave all the .jpg ones alone
Thanks smile

Last edited by Lauraq (2021-06-23 14:57)

Offline

#2 2021-06-24 13:59

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: execute script only with certain extension

Do that inside of the script (and next simply run the script on all files)

https://www.den4b.com/wiki/ReNamer:Pasc … _Utilities
WideExtractFileExt( FileName )



Example:

var
 sExte: WideString;

begin
  sExte := WideExtractFileExt(FilePath);

//This block is not need at all for this very challenge:
  if( WideUpperCase(sExte) = '.JPG') then
    begin
     //ShowMessage( ' do nothing for ' + FileName )
    end;

//Process only if extension match:
  if( WideUpperCase(sExte) = '.FLAC') then
    begin
     //ShowMessage( FileName )
     FileName := 'That is a FLAC_' + FileName;
    end;
  
end.



 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2021-06-24 18:43

Lauraq
Member
Registered: 2016-10-02
Posts: 78

Re: execute script only with certain extension

thanks but don't work. It permit the rename of the jpg in the list and put "That is a FLAC" on top of my flc renamed file. For example:

01 - Azzurri gli oceani

after

That is a FLAC 01 - Azzurri gli oceani

sad

Offline

#4 2021-06-25 08:05

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: execute script only with certain extension

Lauraq wrote:

thanks but don't work. It permit the rename of the jpg in the list and put "That is a FLAC" on top of my flc renamed file. For example:

01 - Azzurri gli oceani

after

That is a FLAC 01 - Azzurri gli oceani

sad




Exactly as requested:

Lauraq wrote:

I would like a script that       acts only on .flac files       and leave all the .jpg ones alone




 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#5 2021-06-25 08:40

Lauraq
Member
Registered: 2016-10-02
Posts: 78

Re: execute script only with certain extension

sorry, i think google translate made some mistakes.
I'll try to be clearer.
If I use a script like this
http://www.den4b.com/forum/viewtopic.php?id=2239
the changes it will make will be on both flac and jpg files present in the folder.
I would like a script to tell all the commands that I will then add, which must act only on the flac and mp3 files and which must not touch the jpg

Offline

#6 2021-06-25 09:11

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: execute script only with certain extension

Lauraq wrote:

...
If I use a script like this
http://www.den4b.com/forum/viewtopic.php?id=2239
the changes it will make will be on both flac and jpg files present in the folder.
I would like a script to tell all the commands that I will then add, which must act only on the flac and mp3 files and which must not touch the jpg



Load only certain file types:
http://www.den4b.com/wiki/ReNamer:Filter_settings
>> Masks  >> All added files (or folders as files) must match specified masks. For example, if you enter *.jpg;*.gif;*.png as an Include mask,



Or select only certain file types in the pane:
http://www.den4b.com/wiki/ReNamer:Files_menu
Files pane has a context menu for managing files, which can be accessed by right-clicking on the files pane
>> Select by Extension



Rules will then work only on that selected file types, ignoring other files in folder.


 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#7 2021-06-25 12:58

Lauraq
Member
Registered: 2016-10-02
Posts: 78

Re: execute script only with certain extension

thanks, the Mask works fine but every time I close and reopen the program, I have to reset it because it doesn't memorize the settings I gave.

However my dream was different, I wanted to create a single preset with some commands that act on the flac and other commands that act on the jpg. It would be nice if, among the Rule entries, there was one that allows you to decide which types of files to apply those rules to

Offline

#8 2021-06-25 13:05

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: execute script only with certain extension

Than that?


http://www.den4b.com/wiki/ReNamer:Using_presets
A "preset" is a set of rules that is saved with a user-defined name.

It can optionally save the Filter setting also.


http://www.den4b.com/wiki/ReNamer:Filter_settings
>> Masks  >> All added files (or folders as files) must match specified masks. For example, if you enter *.jpg;*.gif;*.png as an Include mask,...




 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#9 2021-06-25 13:13

Lauraq
Member
Registered: 2016-10-02
Posts: 78

Re: execute script only with certain extension

I don't understand, do you understand what I want? smile

I would like ONLY ONE preset that contains rules to apply to flac, mp3 and different rules to apply to JPGs

Offline

#10 2021-06-25 13:54

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: execute script only with certain extension

Lauraq wrote:

I don't understand, do you understand what I want? smile

I would like ONLY ONE preset that contains rules to apply to flac, mp3 and different rules to apply to JPGs




Either make two presets (post #8), one for each extension or a set of extension,
or use script (post #2) with different commands based automatically on current extension.





One single preset with different rules automatically for different extension is not supported right now, as far as I see.
I could imagine a kind of "master preset" which contains two or more "normal" presets and execute them one after the other, but I am thinking that is not possible right now.




 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB