View Single Post
  #16  
Old February 27th, 2009, 10:03 PM
Mikuro's Avatar
Mikuro Mikuro is online now
Crotchety UI Nitpicker
 
Join Date: Mar 2005
Posts: 2,698
Thanks: 6
Thanked 55 Times in 50 Posts
Mikuro will become famous soon enough
The duplicate command returns a reference to the new copy. So you just need to store it somewhere.

Try this:
Code:
tell application "Finder"
	set file_list to {the path to me}
	repeat with i from 1 to 5
		set file_list to file_list & {(duplicate file_list)}
	end repeat
end tell
Curly braces are how you make with lists in AppleScript. So first you make a list with one object, then you duplicate that list and append to it. Repeat as desired.

The result is 32 copies of the script, since it doubles the number 5 times over (2^5=32).
__________________
Mac mini — 1.25GHz G4, 1GB RAM — OS 10.5.8

Useful programs: Privoxy, Butler, ffmpegX, VLC, Perian, Tofu, Wcalc
Reply With Quote