Generating Random Filenames Upon Duplication

I’d like to create a slideshow where the images appear randomly, but my software does not allow this, so if I can lake copies of everything with random filenames, it will work.

I started a drag and drop script, but I can’t get the variables to work right, as usual. Please help if you can.

on open these_items
	set doneFolder to (path to desktop as text) & "random:"
	
	repeat with an_item in these_items
		tell application "Finder" to set theName to displayed name of alias an_item
		set theExt to trim(theName as string, ".", "end")
		repeat
			set randName to (random number from 100 to 999) as string
			try
				tell application "Finder"
					duplicate an_item to folder doneFolder
					set name of alias (doneFolder & theName) to (randName & "." & theExt)
				end tell
				exit repeat
			end try
		end repeat
	end repeat
end open

on trim(t, d, func)
	set tid to AppleScript's text item delimiters
	set AppleScript's text item delimiters to d
	if (count text items of t) > 1 then
		if func is "ext" then set t to text 1 thru text item -2 of t
		if func is "end" then set t to text item -1 of t
		if func is "beg" then set t to text item 1 of t
	end if
	set t to text items of t
	tell t to set t to beginning & ({""} & rest)
	set AppleScript's text item delimiters to tid
	return t
end trim

So you want to create a random order of files in a folder for the rest of your script to make this slideshow with?

No, I will use iPhoto or something to make the slideshow, all I want to do is rename a group of files with random names and the original extension.

I found this, it would be nice to inject the commands into an Apple script though:

http://forums.macrumors.com/showthread.php?t=477744