Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: File Operations | file name pattern template support (Read 1269 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

File Operations | file name pattern template support

Hi there,
is there support for file name pattern templates that I'm not aware of? I created a somewhat complex file name pattern template and it is difficult to paste it as a one liner in the File Operations page bcs I have to minify the code first...

What I'm looking for:
Point to a text file with my file name pattern capable of commenting (#) and structure.


Here is my one file name pattern template for various outputs depending on criteria:
Sample output:
#Various Artists:
\Music\VA - Albumtitle (1996) - CD 1 [mp3]\01 - Artist - Tracktitle.mp3
#Official Albums:
\Music\Artist - (1996) - Albumtitle - CD 1 (Disksubtitle) [flac] [24bit]\01 - Tracktitle.flac
#Unsorted Tracks
\Music\unsorted\Artist - Tracktitle.mp3
Code: [Select]
$if(
  $strcmp

#VariousArtist
    (%album artist%,VA),
      %album artist% - %album%
        $if(
          $or(%DISCNUMBER%),$ifgreater(%TOTALDISCS%,1, - CD %DISCNUMBER%,)
          )
       '('%date%')'
        [$if(
          %discsubtitle%, '('%discsubtitle%')'
          )]
        $if(
          $strcmp(%codec%,FLAC),, $lower('['%codec%']')
          )
        \%tracknumber% - %artist% - %title%,
  #1Track
  $if(
    $strcmp
      (%release type%,1Track),
        '['Various']'\%album artist% - %title%,

    #Album
    $if(
      $strcmp
        ($or(%album artist%),%artist),
      %album artist%
        $if(
          %original release date%, - '('%original release date%')', - '('%date%')'
          )
         - %album%
        $if(
          $or(%DISCNUMBER%),$ifgreater(%TOTALDISCS%,1, - CD %DISCNUMBER%,)
          )
        [$if(
          %discsubtitle%, '('%discsubtitle%')'
          )]
        [$if(
          $strcmp(%RELEASE TYPE%,Album),, '['%RELEASE TYPE%']'
          )]
        $if(
          $strcmp(%source%,Vinyl), '['Vinyl']'
          )
        $if(
          $strcmp(%codec%,FLAC),, $lower('['%codec%']')
          )
        $if(
          $strcmp(%__bitspersample%,24),$lower( '['%__bitspersample%bit']')
          )
        \%tracknumber% - %title%,

        #ArtistCompilation
        %album artist%
           - '('%date%')'
           - %album%
          $if(
            $or(%DISCNUMBER%),$ifgreater(%TOTALDISCS%,1, - CD %DISCNUMBER%,)
            )
          [$if(
            %discsubtitle%, '('%discsubtitle%')'
            )]
          [$if(
            $strcmp(%RELEASE TYPE%,Album),, '['%RELEASE TYPE%']'
            )]
          $if(
            $strcmp(%source%,Vinyl), '['Vinyl']'
            )
          $if(
            $strcmp(%codec%,FLAC),, $lower('['%codec%']')
            )
          $if(
            $strcmp(%__bitspersample%,24),$lower( '['%__bitspersample%bit']')
            )
          \%tracknumber% - %artist% - %title%
    )
  )
)

Re: File Operations | file name pattern template support

Reply #1
I don't know of any such feature, but freewares like notepad make it really easy to edit the script to one line and remove spaces. I just tried with your script and it literally took me two clicks to turn it into a pastable version for the file operations set up.
I'm late

 

Re: File Operations | file name pattern template support

Reply #2
freewares like notepad
Notepad++ it is called. Do not confuse with the built-in editor.

it literally took me two clicks to turn it into a pastable version for the file operations set up.
literally two? How?

Re: File Operations | file name pattern template support

Reply #3
freewares like notepad
Notepad++ it is called. Do not confuse with the built-in editor.

Yes, that's the one I meant.


it literally took me two clicks to turn it into a pastable version for the file operations set up.
literally two? How?

The command edit->line operations-> join lines removes all end of line markers.
Then you can remove blanks with the search and replace command. In this case there are meaningful blanks around the dashes in some titleformatting expression, so you would actually need a third step to replace "-" with " - ", and that's it.

A better option would be: edit-> blank operations -> remove unnecessary blank and EOL which would take just one click, but it works properly only with known programming languages. I've seen that notepad++ enables you to set a custom language, but I have no idea how to set it up for titleformatting.



I'm late

Re: File Operations | file name pattern template support

Reply #4
Thank you. That was what I did - I just used Atoms Find/Replace function (Mac here).
Still - try putting such a script together and you will see it is a hasse to convert, copy and paste each time you try to debug...

Re: File Operations | file name pattern template support

Reply #5
This is a half year old but I'm still struggeling with very long file name patterns and extending them even further for more automated renaming and moving.
Script support would be grand!