How to fix 'Invalid procedure call or argument: 'Mid'' error in tt2's deduper program?

I have run tt2's excellent deduper program before but I needed to do it again. When I try to run it on any amount of duplicates, I get the following error:


Line: 1272

Char: 3

Invalid procedure call or argument: 'Mid'

Code: 800A0005

Source: Microsoft VBScript runtime error


I'm not sure what this means or how I can resolve it.


Thanks



[Re-Titled by Moderator]

Posted on Mar 19, 2025 11:25 AM

Reply
7 replies
Sort By: 

Mar 19, 2025 12:48 PM in response to sugarmag25

Hi there,


That line is part of this function:


Function Ext(P)

Ext=LCase(Mid(P,InStrRev(P,".")))

End Function


And it shouldn't cause an error if P is a file path that includes a file extension of the form .<ext> . Offhand I can't think of the circumstances that would lead to this error as empty paths should be handled differently elsewhere in the code. That said I have tweaked the code a little so that it fails more gracefully. If you download a fresh copy of the script it should now list out the string that causes a problem, which might help narrow things down. A quick check suggests there are five places where this function is called. I may have to add additional code after each call to make sure a valid file extension has been returned.


tt2

Reply

Mar 19, 2025 1:33 PM in response to turingtest2

I thought I had downloaded the most recent version (via your site). I have done a little experimenting and it appears that if I select multiple items, and any of those have a "!" (which I take to mean something is missing) next to it, it won't de-dupe any of the block. If I select every other item except the ones that have the "!" and the match to that song, it will de-dupe. I can sometimes de-dupe a small amount of items even if there's a "!" but I haven't figured out why. For the moment I am just doing it in batches to and working around it. It's still faster than manually selecting items. Thank you for your program and thank you for reading my question.

Reply

Mar 19, 2025 1:43 PM in response to sugarmag25

Hi,


I uploaded a new version (1.0.4.9) moments before pushing Post on my reply to you above.


If there are two duplicates, one of which cannot be found, and thus has an exclamation mark, while there is a matching track that can be found, DeDuper should be able to merge any ratings, play counts, and playlist membership to the track that is found, then delete the other entry. Missing tracks have a empty path when checked in script. I'm still unsure why you're getting this error from a section of the code I haven't needed to revisit in 10 years but I'll do what I can to fix it or workaround it.


As a matter of interest are you seeing this error in the initial scanning phase (which also does the merging steps and unchecks the proposed discards) or in the second phase of the script that actually deletes things?


tt2

Reply

Mar 19, 2025 1:59 PM in response to turingtest2

I downloaded the latest version. I am seeing it in the initial phase. If I get the error, it won't delete anything, so I have to make a new selection that either excludes the missing track item(s) or includes it but only if there aren't very many other tracks to process. If I'm selecting duplicates with missing track items only (or with a small amount of other songs), I get a pop up that says "One [or two] missing duplicate was found. Would you like to clean it?" at which point I say yes, and it solves the problem.


My library was all sorts of messed up so I may be the only person to have created this specific error. As I said, I do have my workaround so I am still able to do cleanup, albeit in smaller bits.


Thanks again

Reply

How to fix 'Invalid procedure call or argument: 'Mid'' error in tt2's deduper program?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.