This is a script called ‘ClipID’ . If i have a bunch of ‘.mpg’ clips listed by creation date with random names, I use this droplet to give them a common name:
bTV movie 1.mpg
bTV movie 4.mpg
bTV movie 9.mpg
should become
NewNameGiven01.mpg
NewNameGiven02.mpg
NewNameGiven03.mpg
SCRIPT:
on open fileList
display dialog “Name Files:” default answer “” --user inputs here
set nameheader to text returned of result
tell application “Finder”
if (count of characters of nameheader) > 27 then
activate
display dialog “Header must be less than 27 characters” buttons “Cancel”
end if
end tell
display dialog “First number?” default answer “1”
set counter to text returned of result as number
tell application "Finder" --do changes here
repeat with typeitem in fileList
try
if counter < 10 then set name of typeitem to nameheader & "0" & counter & ".mpg"
if counter > 9 then set name of typeitem to nameheader & counter & ".mpg"
on error errortext
display dialog "An error has occured with file: " & typeitem & " :- " & errortext
end try
set counter to counter + 1
end repeat
end tell
end open
It works great, UNLESS the file names TO BE ALTERED have ‘.1,.2,.3 etc’ AFTER the file extension (.mpg). Example 1:
bTV movie 1.mpg
bTV movie 2.mpg
bTV movie 3.mpg
bTV movie 1.mpg.1
bTV movie 2.mpg.1
bTV movie 3.mpg.1
bTV movie 1.mpg.2
bTV movie 2.mpg.2
bTV movie 3.mpg.2
MY PROBLEM: The script is selecting them for processing by order of NAME instead of CREATION DATE ( the order the list is currently in)
Example 2: It selects them in this order-
bTV movie 1.mpg
bTV movie 1.mpg.1
bTV movie 1.mpg.2
bTV movie 2.mpg
bTV movie 2.mpg.1
bTV movie 2.mpg.2
bTV movie 3.mpg.
bTV movie 3.mpg.1
bTV movie 3.mpg.2
Can anyone make the script process the ‘selected items’ [b] by the order they appear in the containing folder(creation date or date modified)[b].
THANKS!!!
SITCOM