Jump to content

[Solved] Get Windows Media Player Current Playing Song Filename


Recommended Posts

I am using the UDF from here:

http://www.autoitscript.com/forum/index.php?showtopic=27352&st=0

I would like to know how to get the filename of a song that is currently playing in a playlist within the embedded Windows Media Player; (for those of you that wish to be smart elicks: to use in a script that is, as I already know that I can right click the song in the playlist to see the filename). I have searched the MSDN and have found nothing I can comprehend to be useful. Alas, the reason for my posting. I was thinking something like $wmp.currentMedia but it just returns blank. Not sure how to use it really. The entire file path + filename of the song is really what I am after but I think if I can just get the filename of the current playing song I can get the path by other means. Please advise. Thank you in advance.

Edited by netman74501
Link to comment
Share on other sites

The original is like this

Case $setting = "getduration"
            Return $object.currentMedia.duration
    EndSelect
EndFunc

Here is the old with the filename addition hope it helps :) Just add that to the UDF

Case $setting = "getduration"
            Return $object.currentMedia.duration
        Case $setting = "File"
            Return $object.currentMedia.name
    EndSelect
EndFunc
Edited by froufrou
Link to comment
Share on other sites

The original is like this

Case $setting = "getduration"
            Return $object.currentMedia.duration
    EndSelect
EndFunc

Here is the old with the filename addition hope it helps :) Just add that to the UDF

Case $setting = "getduration"
            Return $object.currentMedia.duration
        Case $setting = "File"
            Return $object.currentMedia.name
    EndSelect
EndFunc

Thank you for replying. I need the actual filename not the name of the song. This returns just the name of the currently paying song. For example: Filename is "example.mp3" while the actual song name is "Example Song". Using your suggestion would return "Example Song", not "example.mp3", which is what I need. I have been unable to find a way to get the filename from the playlist within the embedded windows media player.

Edited by netman74501
Link to comment
Share on other sites

This will return full path. :)

Case $setting = "path"
            Return $object.currentMedia.SourceURL

Thank you so much! I thought that had tried that before but I guess I messed it up somehow. Edited by netman74501
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...