• 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
Count files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Count files


  • Subject: Count files
  • From: Peter Mathiessen <email@hidden>
  • Date: Tue, 13 Aug 2002 08:39:20 +0200

Hi all,

I am in need of a script that renames the files in a folder.

Today I am using a random number, but a neat solution would be to use a
counter of some sort.

If the folder contains 3 files, the filename would be:
001.doc
002.doc
003.doc

Anyone?




get random number from 1000 to 3000
set x to result
set search_for_file to alias (the_vol & "Documents:")
set myListforfile to list folder search_for_file without invisibles
repeat with myFilename in myListforfile
set myfile to alias (the_vol & "Documents:" & myFilename)
end repeat
tell application "Finder"
set name of myfile to (x as string) & ".doc"
end tell
_______________________________________________
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.

  • Follow-Ups:
    • Re: Count files
      • From: Roger_Jolly <email@hidden>
  • Prev by Date: RE: Xserve and Applescript
  • Next by Date: Re: Filmaker container field
  • Previous by thread: Re: Xserve breaks Applescript (continued)
  • Next by thread: Re: Count files
  • Index(es):
    • Date
    • Thread