Unicode To Ascii 1.0 [MM2+3]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Unicode To Ascii 1.0 [MM2+3]

Postby trixmoto » Fri Jan 06, 2006 5:35 am

This script (as requested) converts the text fields of the selected tracks from Unicode to ASCII. If the tags are already in ASCII, it will still convert them, but will obviously remain the same.

Code: Select all
'
' MediaMonkey Script
'
' NAME: UnicodeToAscii 1.0
'
' AUTHOR: trixmoto (http://trixmoto.net)
' DATE : 06/01/2006
'
' INSTALL: Copy to Scripts directory and add the following to Scripts.ini
'          Don't forget to remove comments (') and set the order appropriately
'
' [UnicodeToAscii]
' FileName=UnicodeToAscii.vbs
' ProcName=UnicodeToAscii
' Order=16
' DisplayName=Unicode To Ascii
' Description=Convert Unicode To Ascii
' Language=VBScript
' ScriptType=0
'

Option Explicit   

Sub UnicodeToAscii
  Dim tracks,itm,prog
  Dim res, i

  Set tracks = SDB.SelectedSongList
  If tracks.count = 0 Then
     Set tracks = SDB.AllVisibleSongList
  End If
  If tracks.count = 0 Then
    res = SDB.MessageBox("Select tracks to be converted", mtError, Array(mbOk))
    Exit Sub
  End If
 
  Set prog = SDB.Progress
  prog.MaxValue = tracks.count

  For i = 0 to tracks.count-1
    prog.Value = i
    prog.Text = "Converting track "&(i+1)&" of "&tracks.count&"..."
    Set itm = tracks.Item(i)
   
    itm.Title = SDB.toASCII(itm.Title)
    itm.ArtistName = SDB.toASCII(itm.ArtistName)
    itm.AlbumName = SDB.toASCII(itm.AlbumName)
    itm.AlbumArtistName = SDB.toASCII(itm.AlbumArtistName)
    itm.Genre = SDB.toASCII(itm.Genre)
    itm.Comment = SDB.toASCII(itm.Comment)
    itm.Author = SDB.toASCII(itm.Author)
    '.....
   
    itm.UpdateDB
    If prog.Terminate Then Exit For
  Next
 
  Set prog = Nothing
  res = SDB.MessageBox(tracks.count&" tracks successfully converted", mtInformation, Array(mbOk))
   
End Sub

Sub Install()
  Dim inip : inip = SDB.ApplicationPath&"Scripts\Scripts.ini"
  Dim inif : Set inif = SDB.Tools.IniFileByPath(inip)
  If Not (inif Is Nothing) Then
    inif.StringValue("UnicodeToAscii","Filename") = "UnicodeToAscii.vbs"
    inif.StringValue("UnicodeToAscii","Procname") = "UnicodeToAscii"
    inif.StringValue("UnicodeToAscii","Order") = "16"
    inif.StringValue("UnicodeToAscii","DisplayName") = "UnicodeToAscii"
    inif.StringValue("UnicodeToAscii","Description") = "Convert Unicode To Ascii"
    inif.StringValue("UnicodeToAscii","Language") = "VBScript"
    inif.StringValue("UnicodeToAscii","ScriptType") = "0"
    SDB.RefreshScriptItems
  End If
End Sub
Last edited by trixmoto on Wed Nov 07, 2007 12:07 pm, edited 1 time in total.
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Postby trixmoto » Wed Nov 07, 2007 11:36 am

There is now an MM3 installation package available from my website for this script.
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK

Postby Macarena » Wed Dec 26, 2007 6:38 am

Is there any way how to do this only for auto-organize procedure? I would not like to save my filenames with unicode characters as
a) some programs does not support them
b) I have fat32 file system and when later changing OS, it can cause some problems in reading -- definitely it's some uncertainty for me and I would like to get rid off it.

Thanks upfront
Macarena
 
Posts: 613
Joined: Mon Oct 15, 2007 5:39 am
Location: Cologne, Germany

Postby trixmoto » Wed Jan 02, 2008 5:03 am

No, I don't think so, sorry.
Download my scripts at trixmoto.net.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE
trixmoto
 
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK


Return to Need Help with Addons?

Who is online

Users browsing this forum: Bing [Bot] and 19 guests