netman74501 Posted July 14, 2009 Share Posted July 14, 2009 (edited) 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 July 15, 2009 by netman74501 Link to comment Share on other sites More sharing options...
froufrou Posted July 14, 2009 Share Posted July 14, 2009 (edited) 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 July 14, 2009 by froufrou Link to comment Share on other sites More sharing options...
netman74501 Posted July 14, 2009 Author Share Posted July 14, 2009 (edited) 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 July 14, 2009 by netman74501 Link to comment Share on other sites More sharing options...
froufrou Posted July 14, 2009 Share Posted July 14, 2009 This will return full path. Case $setting = "path" Return $object.currentMedia.SourceURL Link to comment Share on other sites More sharing options...
netman74501 Posted July 15, 2009 Author Share Posted July 15, 2009 (edited) 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 July 15, 2009 by netman74501 Link to comment Share on other sites More sharing options...
froufrou Posted July 15, 2009 Share Posted July 15, 2009 Thank you so much! I thought that had tried that before but I guess I messed it up somehow.Happy I actually figured it out,and glad to help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now