|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
|
![]() |
#1 |
Member
Join Date: May 2016
Posts: 98
|
ATF code for indicating a file being in a specific folder
Lately I have been tempering with my ATF a lot. And the only thing I miss is:
an indicator that would show up if the file being played was residing in a specific folder or its sub-folders Is it possible- can I make some $if2 with a path to this folder, without the need to list all of the sub-folders? |
![]() |
![]() |
![]() |
#2 |
Member
Join Date: May 2016
Posts: 98
|
|
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jul 2018
Posts: 12
|
Have you tried something like "c:\path\to\the\desired\folder\*\"? I don't know if it'll work, but it looks like it might.
|
![]() |
![]() |
![]() |
#4 | |
Member
Join Date: May 2016
Posts: 98
|
Quote:
I tried these ones code: code: but all I got was always "NO", no matter if the file was loaded from the drive M or from drive C; and I wanted to get YES for a file from drive M and NO in case of C |
|
![]() |
![]() |
![]() |
#5 |
Major Dude
Join Date: Mar 2010
Location: Canada
Posts: 757
|
Keep trying.
![]() $left(%filename%,1) returns the Drive letter $filename(%filename%) returns the base filename $directory(%filename%,2) returns the name of the folder, up 2 levels See: http://www.meggamusic.co.uk/winamp/d...f.htm#filepart Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin |
![]() |
![]() |
![]() |
#6 | |
Member
Join Date: May 2016
Posts: 98
|
Quote:
I need to have and indicator [which I myself will specify] to show only if a file was loaded from M:\M\-\ or any other subfolders in that location. And in the future this location might shrink to something like M:\-\ or extend to something like M:\M\-\--\ But most of my files are in location M:\Music\NAME-OF-AN-INDIVIDUAL-ARTIST plus few others locations, for which I do not need an indication / marker. I do not need I do not want to see Music or NAME-OF-AN-INDIVIDUAL-ARTIST I only need to see that - or [more preferably] my own indicator / marker substituting for the name of that specific folder, in the beginning or at the end of my ATF displayed by Winamp And so under that link I do not see codes that could accommodate that. Something that would display >>YES<< or whatever characters I wold choose but only then when the file is exactly in M:\M\-\ or somewhere even deeper [in a subfolder or subfolder od a subfolder etc.]. Because there is no such code? Am I right? It seems that the only way I could go around that is to use code: while moving that - folder from drive M to some extra drive that from now on would hold only those files that I currently designate / mark by keeping them in that M:\M\-\ location. But I do not want to do that. I keep all of music and audio files on the M drive; for a more convenient way of keeping a track of them and for easier archive / backup purposes. I could also try to map a folder and / or create a virtual drive- but that would be using more of solutions that divert even further from my modus operandi So- is there a code that would accommodate my need or not? A code that would show X when Y is meet; and that Y is the specified location or its subfolders |
|
![]() |
![]() |
![]() |
#7 |
Late skinner & Moderator
Join Date: May 2003
Location: Argentina
Posts: 1,629
|
A wizard friend of mine
![]() code: Does it? |
![]() |
![]() |
![]() |
#8 | |
Member
Join Date: May 2016
Posts: 98
|
Quote:
code: as it no longer requires from me messing up with drives and folders; thus allowing for a more neat workaround But still I cannot put the very precised path M:\M\-\* M:\M\-\ M:\M\- as all of those three versions inserted where currently the M: is in the code, make that >>YES<< indication stop from showing up [the >>NO<< I have removed myself on purpose] |
|
![]() |
![]() |
![]() |
#9 |
Major Dude
Join Date: Mar 2010
Location: Canada
Posts: 757
|
Maybe this does what you want.
(I attached it as a txt file because the forum was screwing up the code.) Yikes. Nearly 400 characters to produce 1 word! (The max. accepted length of the ATF string is 1022 characters) Winamp ATF is not exactly a high-level programming language. ![]() http://forums.winamp.com/showthread.php?t=399650 Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin |
![]() |
![]() |
![]() |
#10 | |
Member
Join Date: May 2016
Posts: 98
|
Quote:
A] The %filename% at the end- I do not think I need it at all. I have my %filename% already in my current string B] Is >>CorrectDrive<< legit part of the code or place where I am suppose to put a letter of a drive? C] All the YESes I can replace with the characters I will want to see to indicate that state [info] which I am after? D] All the NOs I can remove, leaving just a coma followed by nothing? [Becasue I do not need to see confirmation of a no-state, because for me the no-state is the correct / main one] E] Is that SOME_INDICATOR the place where I put those characters I want to see [thus not the plae where YESes are]? |
|
![]() |
![]() |
![]() |
#11 |
Major Dude
Join Date: Mar 2010
Location: Canada
Posts: 757
|
First, lets clear something up.
You should change the 2 instances of W to M so the code will apply to your file system. In your original question you gave examples like this: M: M:\M\- I don't have an M:\ drive so I used my W:\ drive for testing but forgot to change the letters in my code to match your question. Sorry about that chief. A] %filename% at the end is only there for a comparison, to see whether or not the results are what is desired. B] "CorrectDrive", "NumberOfParts" and "SecondPart" are the names of variables that contain the results of a sub-string. They can be anything. But the words will not be displayed. See the documentation about $puts $put and $get. C] No. Every YES and NO is part of the code. They also could be anything, but you may notice that they are part of $if functions. YES and NO are the possible answers to the question asked by the $if functions. D] No. See above. Don't change them. E] Yes. SOME_INDICATOR is whatever you want to see. And if you don't see that, you'll see BLANK Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin |
![]() |
![]() |
![]() |
#12 |
Senior Member
Join Date: Oct 2018
Posts: 159
|
First- I am sorry for taking so long. That was just rude, as it seemed I had ditched that topic after you having spent time on that code
Second, I will try to past that code in here, your original and mine with some minor adjustments applied to it: code: code: [In both versions all of the above should of course be written in one long line, with every part / sub-line touching the next one] As you can see: 1] I replaced >>W<< with >>M<<, which is suppose to mean the letter of the drive 2] I capitalized %filename% [not really important, I did that just for better readability] 3] I chosen code: as a clear indication for the negative case [indication] 4] I removed the positive indication completely, as to not waste space on the Playlist and Songticker for showing me some marker when I do not need it to see it [as for me it is the normal state than I expect to see for 99.99% of the time] And it works. I can stick literally right next to it my previous ATF code and see that triangle whenever a file is residing in... folder M of drive M. Was that your intention? It was mine as that is exactly what I was after, as I keep in folder M or its sub-folders files that are most likely to be deleted or somehow worked on- but to which files I still listen too altogether with all of the other normal files. And so my triangle tells me that such file is to be deleted or taken care of in some other way But if your >>W<< meant drive and my >>M<< means folder - how is that possible? All my files are on drive >>M<< but those which are to be marked with my triangle indicator are residing only in folder >>M<<. And that second code does this |
![]() |
![]() |
![]() |
#13 | ||
Major Dude
Join Date: Mar 2010
Location: Canada
Posts: 757
|
Quote:
Quote:
I had no details of your file system so I assumed the drive could be anything and the next folder (SecondPart) could be anything. In the code, the variable name "SecondPart" means "the 2nd part of the file path", which is a folder. If all your files are always on drive M, then the code that deals with "CorrectDrive" is probably unnecessary. Windows 10 Home, 64 bit, Winamp 5.666, Bento Skin |
||
![]() |
![]() |
![]() |
|
Tags |
advanced title formatting, atf, directory, path |
Thread Tools | Search this Thread |
Display Modes | |
|
|