Clean Scripts.ini

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Clean Scripts.ini

Post by onenonymous »

This script will clean the orphaned entries out of your Scripts.ini file. Please backup your files before running (just in case). I recommend Trix's Backupscript. The script is very basic. It reads through the Scripts.ini file looking for [SomeScript] followed by Filename=somefile.vbs, then checks to be sure that somefile.vbs exists. It puts up a message box for each script entry it can't find. Click yes to delete the entry or no to leave it in place. It repeats with a new message box for each missing script. Tested on MM3.

Installer file: CleanScriptsIni.mmip

Version 0.8 Update March 23, 2008
-Fixed code to delete entries which failed if the entries were at the end of the script
-Added Option sheet
-Removed access from scripts menu
-Added ability to turn on/off logging and messaging
-Changed logging to make it easier to copy the entry from the log and paste it back into the scripts.ini file if needed

Version 0.81 Update March 23, 2008
-Fixed code to show message box before changes

Here are screen shots:
Image

Image
Last edited by onenonymous on Sun Mar 23, 2008 2:16 pm, edited 3 times in total.
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan »

One:

I cannot test this for you since I just cleaned up my scripts.ini in order to fix problem with RC4S script, but I have one query. Does this give a report of what it will be cleaned out of the ini file? If not, would it be possible to add some type of report, I would like to know what is being removed.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous »

For now, it's pretty basic. It puts up a message box for each script entry it can't find. Click yes to delete the entry or no to leave it in place. It repeats with a new message box for each missing script.

When I get a chance, I'll enhance it to read through the entire file, the put up one dialog box showing all missing scripts with a checkbox by each to let you choose which ones to delete.
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan »

No need to enhance any further, the message box would be enough for me to know whether I wanted it removed or not. One other question, if there are ini entries which are commented out, will it ask to delete those??

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous »

It shouldn't. It looks for [SomeScript] followed by Filename=somefile.vbs, so if those are commented, they will be ignored.
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan »

Cool 8) Too bad I don't have any way to test it. :cry:

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous »

Updated script - see first post

Version 0.8 Update March 23, 2008
-Fixed code to delete entries which failed if the entries were at the end of the script
-Added Option sheet
-Removed access from scripts menu
-Added ability to turn on/off logging and messaging
-Changed logging to make it easier to copy the entry from the log and paste it back into the scripts.ini file if needed
RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post by RedX »

Nice script!

Maybe add a messagebox if no problems were found as it was confusing to know wether it had run sucessfully or not (looked at the log file).

But still nice idea ;-)

Regards,
Red
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous »

RedX wrote:Maybe add a messagebox if no problems were found as it was confusing to know wether it had run sucessfully or not (looked at the log file).
Regards,
Red
It is supposed to do as you suggest if the 2nd check box ("Ask permission each time") is checked. I checked my code and had a an extra 'Not' that I forgot to remove. I'll fix and re-post.

EDIT - installer has been updated.
Vyper
Posts: 845
Joined: Tue May 23, 2006 5:53 pm

Post by Vyper »

Works a treat. Image
Stop Button Freak
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Post by nynaevelan »

One:

Is it possible to have this script review the scripts.ini file and put the script data in the order that the user specifies? Right now I have my script.ini file separated by script type and ordered alphabetically but each time I install a new script I have to manually reset the order. Is something like this possible or will I have to keep doing it manually??

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous »

nynaevelan wrote:One:

Is it possible to have this script review the scripts.ini file and put the script data in the order that the user specifies? Right now I have my script.ini file separated by script type and ordered alphabetically but each time I install a new script I have to manually reset the order. Is something like this possible or will I have to keep doing it manually??

Nyn
I've got my working copy with a button to sort the entries alphabetically. I need to clean it up so it can be posted. I'll see about doing that this weekend.
Vyper
Posts: 845
Joined: Tue May 23, 2006 5:53 pm

Re: Clean Scripts.ini

Post by Vyper »

Did you ever do nyn's request? :)
Stop Button Freak
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Clean Scripts.ini

Post by nynaevelan »

Wow Vyper I forgot about this one, but I've still having to update my ini manually and I install a lot of scripts but I guess this is the beast I have to live with. Unless of course the scripters figure out a way to not overwrite the ini entries if they already exist?? :wink:

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Re: Clean Scripts.ini

Post by onenonymous »

This one got back-burnered behind my other scripts (and life away from the monkey...). I'll see about re-visiting it one of these days. If I recall, I changed my parsing routines that reads scripts.ini in my RCFS script, and intended to use that in this one - just never got to it.
~One
Post Reply