Run Script vs. Step-through Script
Posted: 27 Aug 2014 20:58
I'm getting different results when stepping through a script than what I get when I run the same script. Stepping through it produces proper results; running it causes errors. How is that possible?
Here's the script. The audio files that will make up the M3U playlist are selected before running the script:
When I run the script, it fails at the "run" line because Mp3tag reports that it can't access the file. But when I step through the script, Mp3tag opens the .m3u file properly. I've tried many things, including the openwith command. I've tried declaring and setting variables at each step in an effort to try to slow down the processing of the script when I run it. What am I doing wrong?
Thanks,
Jeff
Here's the script. The audio files that will make up the M3U playlist are selected before running the script:
Code: Select all
//Create the m3u playlist then open it in Mp3tag.
setting BackgroundFileOps, 0; //Trying to slow things down.
writefile ("<curfolder>.m3u", getinfo("SelectedItemsPathNames"), o); //Write the .m3u file.
selectitems "<curfolder>.m3u"; //Select the .m3u file so we can get its full path in the next step.
$newFileNamePath = get("SelectedItemsPathNames");
run """C:\Program Files (x86)\Mp3tag\Mp3tag.exe"" /fn:""$newFileNamePath""", , 1,1; //Run Mp3tag with command-line parameters. Make script wait modally.
selectitems "$newFileNamePath"; //Ensure the .m3u file is selected before we try to delete it.
delete 1, 0, :list; //Delete the m3u file because we're done.Thanks,
Jeff