REshuffle Smart playlist mysteriously deleted my library

GO TO ADMIN PANEL > ADD-ONS AND INSTALL VERTIFORO SIDEBAR TO SEE FORUMS AND SIDEBAR

jmargolese

New member
Joined
Jan 18, 2008
Messages
1
Points
0
I installed and ran Doug's Reshuffle Smart PLaylists script. First time, last week it ran perfectly.

Tried it again yesterday and it deleted all the tracks in my library AND all the physical tracks for any music in my smart playlists. I've got backups of most of it, but it will be a pain to rebuild. (Yes, it was running slow, but as it happened I left for a while while it was running and didn't have any reason to suspect a massive physical deletion.)

My real question is HOW could this happen?

The script is below, and looks pretty safe. Anyone got any ideas on what might have gone wrong?

Thanks

tell application "iTunes"
repeat with x from 1 to count of user playlists
if user playlist x is smart then
try
delete tracks of user playlist x
on error

end try
end if
end repeat
end tell
 

S2_Mac

New member
Joined
Oct 24, 2006
Messages
4,876
Points
0
Location
About 3 feet in front of the monitor
Yowsers! Has no ill effects for me (X 10.3.9 and iTunes 7.2), but something under the hood of your versions is not playing nice |<

Write to Doug asap to let him know about this. Be sure to include your OS version and iTunes version (might not hurt to mention how your "Copy files to iTunes Music folder when adding to Library" pref is set, too).

Normally, the context for "track" in that script would be "an entry in a playlist". Somehow your system is seeing the context as "the file associated with an entry in a playlist" (aka "file track"). With any luck, Apple will have someone else test the iTunes 7.6.1 code ;-)
 
Joined
Jul 1, 2003
Messages
705
Points
0
Location
Providence, RI, USA
Website
dougscripts.com
That's bad news. Regrettably, that script has not been updated recently. The reason it deleted everything is because the Master Libraries are ALSO Smart Playlists. I am removing this script from the site until it can be updated.
 

p4ul13

New member
Joined
Jan 28, 2008
Messages
1
Points
0
Same story here...

I'd been using that script for probably a couple years without a problem. Last weekend my library was wiped out and I restored it with Time Machine. I didn't figure out the cause till this weekend when my iCal event that runs the script once a week ran. Sooo I'm restoring from Time Machine (again).

I'm running OS X 10.5.1, all patches and updates and iTunes 7.6. I don't think this started till after the upgrade to 7.6.
 

misterking

New member
Joined
Jan 30, 2008
Messages
1
Points
0
Ahhhhh, do NOT use Reshuffle Smart Playlists script with iTunes 7.6!

It happened to me twice. The first time I didn't know what caused it because I wasn't watching. What a pain!
 

brontide

New member
Joined
Mar 12, 2008
Messages
1
Points
0
Fixed, I tried sending this directly to Doug, but alas ... no reply. The fix ended up being fairly trivial. Only reshuffle non-special smart playlists.

Code:
(*
"Reshuffle Smart Playlists" for iTunes
written by Lukas Bergstrom / Eric Warnke <[email protected]>

v1.1 Mar 4, 2008 Eric Warnke
-- Prevent operation under 7.6 and exclude all Special playlists

v1.0 feb 15, 2006
-- initial release

Get more free AppleScripts and info on writing your own
at Doug's AppleScripts for iTunes
http://www.dougscripts.com/itunes/

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

Get a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

or visit http://www.gnu.org/copyleft/gpl.html

*)


tell application "iTunes"
	if version of application "iTunes" is "7.6" then
		display dialog "This script does not run under iTunes 7.6, please upgrade to 7.6.1"
	else
		repeat with x from 1 to count of user playlists
			if special kind of user playlist x is none then
				if user playlist x is smart then
					try
						delete tracks of user playlist x
					end try
				end if
			end if
		end repeat
	end if
end tell
 
Top