ExtensionToLowercase v1.1 [MM2+3]

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: ExtensionToLowercase v1.1 [MM2+3]

by Snow123 » Tue Jun 17, 2008 2:19 am

This script changes the file extension to lowercase for all selected files.

Re: just curious why

by Guest » Sun Jun 01, 2008 4:43 pm

thanks wrote:Is it bad to have some e.g. ".MP3" files extensions (instead of ".mp3")?

Is there some case when it's important to have lower case file extensions?

Thanks for the cool TI script, Bex.
Actually, I had a big problem once with someone once that would not work with the uppercase file extensions on mp3s. Can't remember what it was now, though--possibly something for my phone.

by thanks » Sun May 25, 2008 11:52 am

Bex wrote:Thanks!
Not that I know of. It's only for aesthetic reasons.
No, thank you! Tak, to be precise. Or something like that.

Crikey, I've been wondering that for such a long time. I can sleep easy now.

by Bex » Sun May 25, 2008 5:26 am

Thanks!
Not that I know of. It's only for aesthetic reasons.

just curious why

by thanks » Sun May 25, 2008 5:21 am

Is it bad to have some e.g. ".MP3" files extensions (instead of ".mp3")?

Is there some case when it's important to have lower case file extensions?

Thanks for the cool TI script, Bex.

by Bex » Tue May 06, 2008 7:30 pm

Yes, my Tagging Inconsistencies script has such node. It find tons of other things as well. Link in signature.

Why?

by Thanks » Tue May 06, 2008 6:39 pm

I've always wondered why it's desirable not to have upper-case file extensions. Presumably there is some reason?

Assuming there is, is there a script to find all the tracks with an upper case file extension - i.e. before you use this script?

Many thankis. [That was a typo but I think I'll leave it as it is!]

by Peke » Tue Apr 22, 2008 10:44 am

It feels great, doesn't it?
FYI little bugs are hardest to track ;)

by MoDementia » Mon Apr 21, 2008 11:53 pm

Woot I add 1 word and I get all the credit :P

by Snow123 » Mon Apr 21, 2008 11:46 pm

This script changes the file extension to lowercase for all selected files.
Works great, thanks MoDementia! :D

by Steegy » Tue Apr 01, 2008 11:40 am

Hah... "Then" was missing... strange error :-?

by nohitter151 » Tue Apr 01, 2008 12:16 am

Works great, thanks MoDementia!

Of course, thanks to Steegy as well :D

by MoDementia » Mon Mar 31, 2008 11:57 pm

I didnt work for MM2 :) but yes it works for both now

Code: Select all

'====================================================================================
'
' MEDIAMONKEY SCRIPT: ExtensionToLowercase v1.1 (last updated 2007-01-02)    by   Steegy
'  Initiated on 2006-02-17
'
'  The ExtensionToLowercase script changes the file extension to lowercase for all selected files.
'
' Installation instructions:
' - Copy this script as plain text file named ExtensionToLowercase.vbs, to the MediaMonkey Scripts folder
' - Add a script entry to file Scripts.ini (example shown below)
'
'  [ExtensionToLowercase]
'  FileName=ExtensionToLowercase.vbs
'  ProcName=ExtensionToLowercase
'  Order=7
'  DisplayName=ExtensionToLowercase
'  Description=ExtensionToLowercase
'  Language=VBScript
'  ScriptType=0
'
'==========================================================================

Sub ExtensionToLowercase

  Dim mySongList : Set mySongList = SDB.CurrentSongList
  If mySongList.Count = 0 Then
    SDB.MessageBox "Nothing selected!", mtError, Array(mbOK)
    Exit Sub
  End If

  Dim i, mySong, Result
  For i = 0 To mySongList.Count - 1
    Set mySong = mySongList.Item(i)
    Result = FilePathExtensionToLowercase(mySong.Path)
    If Result <> "" Then
      mySong.Path = Result
      mySong.UpdateDB
    End If
  Next

End Sub


Function FilePathExtensionToLowercase(FilePath)
  FilePathExtensionToLowercase = ""

  Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")

  If FSO.FileExists(FilePath) Then
    Dim File : Set File = FSO.GetFile(FilePath)
    If FSO.GetExtensionName(File) <> LCase(FSO.GetExtensionName(File)) Then
      FilePathExtensionToLowercase = File.ParentFolder.Path & "\" & FSO.GetBaseName(File) & "." & LCase(FSO.GetExtensionName(File))
    End If
  End If

End Function

by nohitter151 » Mon Mar 31, 2008 11:21 pm

Will this script work for MM3?

ExtensionToLowercase v1.1 [MM2+3]

by Steegy » Thu Feb 16, 2006 7:19 pm

ExtensionToLowercase forum post.

This script changes the file extension to lowercase for all selected files.

The script consists of 1 script file ("ExtensionToLowercase.vbs").
See How do I install scripts? for more help on installing the script.

ExtensionToLowercase.vbs (for the Scripts folder)

Code: Select all

'====================================================================================
' 
' MEDIAMONKEY SCRIPT: ExtensionToLowercase v1.1 (last updated 2007-01-02)    by   Steegy
'  Initiated on 2006-02-17
'
'  The ExtensionToLowercase script changes the file extension to lowercase for all selected files.
'
' Installation instructions: 
' - Copy this script as plain text file named ExtensionToLowercase.vbs, to the MediaMonkey Scripts folder 
' - Add a script entry to file Scripts.ini (example shown below)
'
'  [ExtensionToLowercase]
'  FileName=ExtensionToLowercase.vbs
'  ProcName=ExtensionToLowercase
'  Order=7
'  DisplayName=ExtensionToLowercase
'  Description=ExtensionToLowercase
'  Language=VBScript
'  ScriptType=0
'
'==========================================================================

Sub ExtensionToLowercase

  Dim mySongList : Set mySongList = SDB.CurrentSongList
  If mySongList.Count = 0 Then
    SDB.MessageBox "Nothing selected!", mtError, Array(mbOK)
    Exit Sub
  End If

  Dim i, mySong, Result
  For i = 0 To mySongList.Count - 1
    Set mySong = mySongList.Item(i)
    Result = FilePathExtensionToLowercase(mySong.Path)
    If Result <> "" Then
      mySong.Path = Result
      mySong.UpdateDB
    End If
  Next

End Sub


Function FilePathExtensionToLowercase(FilePath)
  FilePathExtensionToLowercase = ""

  Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")

  If FSO.FileExists(FilePath) Then
    Dim File : Set File = FSO.GetFile(FilePath)
    If FSO.GetExtensionName(File) <> LCase(FSO.GetExtensionName(File)) Then
      FilePathExtensionToLowercase = File.ParentFolder.Path & "\" & FSO.GetBaseName(File) & "." & LCase(FSO.GetExtensionName(File))
    End If
  End If

End Function

Top