Welcome Guest

Pages: 1
Delete jpg file if named like: ❨Album Artist❩ - ❨Album❩.jpg
Gary-SwiftPostJune 17, 2023, 11:04
Newbie
Posts: 24
Registered:
April 29, 2014, 06:12
Normal topicDelete jpg file if named like: ❨Album Artist❩ - ❨Album❩.jpg

I would like to be able to delete a jpg file if it follows this naming convention (without the brackets):

Album Artist - Album.jpg

So the file will be different each time but it will follow the same naming convention.

I have looked at "Test If File Exists" function but it looks like expects me to know the name of the beforehand as does "Thrash Files And Folders".

2MR2PostJune 17, 2023, 11:30
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicDelete jpg file if named like: ❨Album Artist❩ - ❨Album❩.jpg

Escape sequences are your friends 🙂

The attached screenshot trashes the file but it will work with Delete Files and Folders as well. It will only delete one file. If you want it to be processed for each folder of a selected audio file it will take a little more work.
Image

2MR2PostJune 17, 2023, 15:31
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicDelete jpg file if named like: ❨Album Artist❩ - ❨Album❩.jpg

If you want to delete the files in every folder containing a selected track, the following snippet works:

Set Variable 0 to "\!Path to Folder!/\[Album Artist] - \[Album].jpg"
Build List with delimiter "⏎" in named variable 'Deleted Files' from field Variable 0 string delimiter "\~"
Trash Files and Folders: "\<Deleted Files>"

Gary-SwiftPostJune 18, 2023, 07:09
Newbie
Posts: 24
Registered:
April 29, 2014, 06:12
Normal topicDelete jpg file if named like: ❨Album Artist❩ - ❨Album❩.jpg

This is incredible! I continue to be blown away by the capability of Yate.

The first solution was sufficient for my needs. I tried your suggestion and it works exactly how I wanted it to.

Thank you very much. I really do appreciate the effort you put into your replies. 😀 😆 😀

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.01 seconds.