GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Help using & hiding Play All button for music

Hi All. I just can not understand how to use this code perfectly?

I had tried to make this button in this way.
I copy this code form this post


I edit the path with my demo folder like this

This button never hide automatically, but can play the music files with pot player

I want tow things

  1. I go to any folder from any location of my PC, If this folder contain any music type file, then this button will show automatically otherwise the button will automatically disappear if the folder does not contain any music type file.
  2. when i click on the button all the music type file will play with windows media player, is that possible?
    Can any one give me .dfc file for this button?

I have no idea why it wouldn't auto-hide outside the specified (sub)folder(s). This exact code works for me...

Not sure, try playing with @hide:!type=grp:Music (instead of path check)

In your current button, simply replace the existing ContextMenu Open with "%ProgramFiles(x86)%\Windows Media Player\wmplayer.exe" {allfilepath$}

Thanks bytespiller for helping me. My 2nd wants is fill-up now. now when I click the button all kinds of music files play with WMP, its fine.
The Only Problem is that The Button does not Hide automatically. I want this button will always hide when I browse any folder does not contain any kinds of Music File. What is wrong with my button code? Plz Help me!!
1

@hide:!type=grp:Music
@filesonly
@useactivelister
Select grp:music
"%ProgramFiles(x86)%\Windows Media Player\wmplayer.exe" {allfilepath$}

There's no way to hide/show an individual button based on the types of files in the current folder.

You could hide/show it based on the types of selected files, but that probably isn't what you want with his button since it selects files itself.

You could hide/show the button based on the folder path, which is easy enough. (I suspect it wasn't working when you did that above because your wildcard would only match sub-folders of the path you were interested in, not the path itself.)

Or you could have a toolbar with the button on it, and turn that toolbar on/off via the Music format, if Content Type Detection is turned on. (Assuming the folders are mostly music files and not a mixture of lots of other files.)

Thanks Leo for your valuable instruction. Now I am very clear "There's no way to hide/show an individual button based on the types of files in the current folder."
Then I have multiple path for music collection folder
example:
D:\English Music
E:\Enterenment\Hindi Music
F:\Enjoyment\Bangla Music
The 3 example folder have a lots of child folder contain Music files.
Is that possible I add this parent folder path in my button and the button will show for all child folder of this parent folder?
How can I add multiple Parent folder path for this button when the button will automatically show, otherwise The button will Hide. If possible then How to do That?

I would use this:

@hideifpath:!*Music*

Then the button will show if "Music" is somewhere in the path and hide otherwise.

You can make the pattern more specific if needed, but that's probably all you need.

Hi Leo I am sorry. it's my bad, I give you the wrong name as the example folder name. But I have no idea you was take the a common word music as a wildcard. Actually The real parent folder path have no word like music and no common word also. So I just want to know how to add multiple parent folder path in this button?

It would be easier to tell you the wildcard to use if you tell us what the actual paths are. :slight_smile:

Hi Leo here is the parent folder path's
D:\audio cd\flac file\Secure Rip
E:\collection\mp3\others
F:\Entertainment\audio songs\others

@hideifpath:!(D:\audio cd\flac file\Secure Rip|E:\collection\mp3\others|F:\Entertainment\audio songs\others)*
1 Like

Thanks Dear Leo, it's work for me perfectly.