For some reason I'm getting a runtime error when specifying ".m4a" (itunes) files in silent mode, targeting a folder. A new playlist, including m4a files, is complied, so the output is still working. Simply changing the script's preexisting ".wma" to ".m4a" creates the error. No errors with any other file ext (and/or manually via "send to"??).
Error: Invalid procedure call or argument (800A0005)
This is very strange, Si1verfish! I've been tinkering around with it, attempting to re-create the error on my WinXP system, and I can't. Line76:Char3 is the beginning of the statement that writes the filename string into the playlist text file:
Originally Posted by si1verfish
I can't think of any reason why a filename with a specific extension (.m4a) would trigger a runtime error when treated strictly as a character string for output to a text file, while other filenames do not. Please post back if any other behavior you notice helps illuminate this issue for us. Thanks.
Si1verfish -- One possibility did just now occur to me. It seems possible that there could be a filename (which just happens to be one of your iTune files) that somehow has a non-ASCII character in the filename that triggers this error when its name is being written to an ASCII text file.
In order to troubleshoot this, here are a couple of script lines for you to insert. First, find the line in the original script that triggered this error (the line in bold from my last comment). Copy this next line below, and paste it directly following that script line that caused the error:
If Err.Number Then MsgBox Err.Description & Chr(10) & FileList(FilePool(RndPick)), vbOKOnly, "Error # " & CStr(Err.Number): Err.Clear
(if your browser splits the above text into two lines, make sure you correct it so it's a single line)
You'll notice that these lines are in the middle of a While/Wend block. Just before that "While" line (and just after the "Randomize" line that precedes it), insert the following line:
On Error Resume Next
Now run the script in the same context and manner where it triggered your original error. Every time an error occurs now, you'll get a dialog that shows the filename being handled when the error occurred. I'm hoping that we'll see that a single music filename is triggering this runtime error, and maybe you'll be able to figure out why. Good luck, and let me know how it went.
Last edited by GaryM; 04-20-2010 at 10:39 PM.
I isolated the issue to a single m4a file name (from CD>iTunes rip), with an unrecognized character. Thanks for taking the time to help me on this. It's definitely been worth the effort for me.
My pleasure! Now go spread some joy
Hey first off this is a great script.
I just have 1 question.
I want the script to target only 1 folder and not every folder with .mp3 in it.
can this be done in the script?
I am a complete noob to this and have no coding experience what so ever.
The idea here is that i can get a play list made form say a folder called rock
and then have a second script used to make a play list from a folder called classical
the problem i have at the moment is when i use the script is will make a list from all folders in the music dir.
Any way of making it just target the one folder and still put the playlist in the music folder?
Never mind figured out a way to do it myself
I created a batch file like this
Wscript.exe "C:\Music\Type1\Randomized_Playlist_Maker.vbs" /s "C:\Music\Type1"
copy c:\music\Type1\_RandomPlayList1.m3u c:\Music
That allowed me to create the play list using the music in a single folder
and then just copy that file to the root directory.
This works well for me and make creating play list of particular types
Have to say i love the script and it works really well
Is there a limit to the amount of songs one can put into the play list?
Yeah, with the ongoing saga of patiently waiting & waiting for the next firmware update (hoping for a BASIC music shuffle feature) and only getting "form responses" from PM (no idea when the update will occur - no details, no info! - not even a release month), I think I may give this a try.
I have the same question; Is there a limit to the music playlist capacity? Would this be somehow limited by the PBO itself (overhead memory)?
I'll put it through some tests tonight. Looks pretty promising, thanks for the work on this!
I don't know if there is a playlist 'max capacity', but mine is 10,000+ songs with no issues. Once setup, I would simply target the existing .m3u file as it renders the reshuffle much quicker than targeting a entire folder (where it has to compile, then reshuffle). If you add/subtract music often then the folder option is the way to go.
I stopped by the forum because I thought I smelled the faint aroma of freshly-baked firmware cooling in the open air, but the preliminary verdict seems to be that "P05" is only half-baked at best. Oh well...
I may be late getting to the party, but I didn't come empty-handed. I uploaded a revised version of the Randomized_Playlist_Maker script that incorporates an extra dialog with the option to specify a custom name for the playlist, and also the option to locate the playlist in a directory closer to the root of the disk, as suggested a few comments earlier by yrthilian. Also, the default suggested playlist filename is now based on the name of the target folder from which the playlist is compiled. The original links from the first post in this thread lead to the revised script file, and I edited that post to reflect the additional features. Play around with it while you wait for the P06 firmware.
Regarding questions about the size limit on playlists, rather than using a hard limit, the script starts out by allocating slots for 100 songs, and every time it reaches its limit it allocates another 100 slots. It may crash when it tries to fill the 32,768th slot, but I'm pretty sure that by the time the Playlist Maker even comes close to its limit, the PBO will be coughing and wheezing like a lifelong smoker ;-)