Re: duplicate one file
Re: duplicate one file
- Subject: Re: duplicate one file
- From: John Delacour <email@hidden>
- Date: Sat, 3 Aug 2002 20:00:43 +0100
At 3:46 pm +0200 3/8/02, Mirko wrote:
aie aie....so is not possible to simply duplicate a lot of same file with
applescript ??
in fact i run on OS.9.1...not with OS X...
the code John provide me is Perl language ?? and i can duplicate one file
inside a folder of my website ?? is this you mean..?? or is applescript code
??
thanks for some clarification....
Ah. I thought you mentioned OS X. Here's a script that will do what
you want. It takes about ten seconds on my machine to create the
files this way. With perl it would take about 1/100th of that time I
guess.
set dsk to "" & (path to startup disk)
set fdr to "junk_folder"
set props to {name:fdr}
tell app "Finder"
try
make folder at alias dsk with properties props
on error e
end
end tell
set dir to dsk & fdr & ":"
set fName to "junk.html"
set pathname to dir & fName
open for access file pathname with write permission
set eof file pathname to 0
write "<b>junk</b>" to file pathname
close access file pathname
set fContent to read file pathname
repeat with i from 1 to 1000
set n to text -4 through -1 of ("" & (10000 + i))
set f to dir & "junk" & n & ".html"
open for access file f with write permission
write fContent to file f
close access file f
end
tell app "Finder" to reveal alias f
(* JD *)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.