Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gs86

macrumors newbie
Original poster
Oct 13, 2011
1
0
I have a script that I've written below

I would like to repeat the script for multiple files ie drop multiple files onto the Droplet and the action below is carried out on all the file.

I've had a stab at repeat/loop but to no avail

I've cobbled the script together to use the name of a file to set the creation date on the file:-

Any ideas how to amend the below

on open theFiles

set theName to name of (info for theFiles)
set yy to characters 1 through 2 of theName as text as integer
if yy < 10 then set yy to "0" & yy
set mm to characters 3 through 4 of theName as text as integer
if mm < 10 then set mm to "0" & mm
set dd to characters 5 through 6 of theName as text as integer
if dd < 10 then set dd to "0" & dd
set hh to characters 8 through 9 of theName as text as integer
if hh < 10 then set hh to "0" & hh
set mn to characters 11 through 12 of theName as text as integer
if mn < 10 then set mn to "0" & mn

do shell script "touch -t " & yy & mm & dd & hh & mn & " " & quoted form of POSIX path of theFiles
end open
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.