• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to naming files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to naming files


  • Subject: Re: How to naming files
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 11 Dec 2000 23:33:33 -0800

On 12/11/00 11:04 PM, "Peter Mathiessen" <email@hidden> wrote:

> Hi,
>
> I got several files that I need to name like this: 001_001
>
> My problem is how to make a script that counts and will name the files like
> this: 001_001, 001_002, 001_003 and so on. If the files reach 001_999 the
> script should continue with 002_001 ans so on.
>

Assuming you want to be able to continue in sequence when running the script
many times:

property x : 1
property y : 1

tell application "Finder"
-- define a group of files as theFiles in some way
repeat with aFile in theFiles
set n to (text -3 thru -1 of ("00" & y)) & "_" & (text -3 thru -1 of
("00" & x))
set x to x + 1
if x = 1000 then
set x to 0
set y to y + 1
end if
set name of aFile to n
end repeat
end tell

--
Paul Berkowitz


References: 
 >How to naming files (From: Peter Mathiessen <email@hidden>)

  • Prev by Date: Re: scripting Photoshop
  • Next by Date: Re: Accessing Finder on an AirPort network?
  • Previous by thread: How to naming files
  • Next by thread: Re: scripting Photoshop
  • Index(es):
    • Date
    • Thread