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