Announcement

Collapse
No announcement yet.

Clearing playlist

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Clearing playlist

    does anyone know how to clear a playlist using a script?

    #2
    I do it like this

    Code:
    Sub ClearPlay(ByVal Data As Object) 
    
    hs.Plugin("Media Player").musicApi.StopPlay()
    hs.Plugin("Media Player").musicApi.ClearCurrentPlaylist()
    
    End Sub
    and that is part of a bigger script, I call that specific function when I press the clear playlist button. Depends on what media plugin you are using, you may need to change it.

    Comment


      #3
      So i can use that same script for deleting a song off my playlist and just modify it a little bit

      Comment


        #4
        I get a little confused around playlists because there can be saved playlists and the current playlist (that I am not sure is saved anywhere but is what WMP is playing at the moment), that code clears the current playlist WMP has. There are other commands in the Music API like PlayListDeleteTrack/PlayListAddTrack that look to delete tracks from saved playlists.

        Comment


          #5
          ok so i put that into a script and ran it when i pushed a button and nothing happens to the playlist can you tell me what i am doing wrong with it?

          Comment


            #6
            It gave me an errror

            Error: entry point function not found: Main

            Comment


              #7
              That is only part of my script, you either need to cut the two lines out and put it in your script or call ClearPlay rather than Main

              Comment


                #8
                I got it to work thanks for the help!

                Comment


                  #9
                  What about too add a song to the playlist?
                  And make a new playlist?

                  Comment


                    #10
                    Adding a track to a playlist is simple you make a selection boxs' status tracking to music selector then go to actions when selected and under action type you select Music: Add Selected Track To Playlist

                    Comment


                      #11
                      Also I dont know how to make a new playlist but if you figure it out please let me know
                      how

                      Comment


                        #12
                        Is this the WMP plugin you are using? If you look in the help file there are a number of playlist related commands you can use. To create a playlist you call PlayListCreateNew and pass the name of the playlist as a parameter.

                        Comment


                          #13
                          Is it possible to use a keyboard to set the parameter

                          Comment


                            #14
                            It will depend on exactly what you are trying to do, you would stand a better chance of having a text box on the HSTouch page, when you highlight the box you have a text input option. You could then have another button that sent the value into another script and then created a new playlist. That is only creating a playlist though...adding tracks to it will be another headache entirely.

                            Comment

                            Working...
                            X