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

Re: Count and rename files


  • Subject: Re: Count and rename files
  • From: Emmanuel <email@hidden>
  • Date: Wed, 24 Sep 2003 11:57:01 +0200

At 10:48 AM +0200 24/09/03, Peter Mathiessen wrote:
>Hi all,
>
>Is it possible in some easy way to change the name of a file or rather a
>bunch of files to this - 0001.eps, 0002.eps etc.
>
>Problem:
>Folder containing 100 files. the filenames are different and also the
>suffix. Want a script to count the files and rename them to 30001.xxx2,
>30002.xxx2 and up to 30100.xxx2.
>
>The suffix can be different, 3eps2, 3tif2, 3.psd2 etc. The amount of files
>can also be different.
>
>I have tried different solutions but no one seems to do the job.
>
>Thanks in advance!
>Peter
>
>
>copy "Macintosh HD:Script_folder:Count_rename_files:" as text to the_vol
>set searchFolder to alias (the_vol & "Folder_in")
>set destinationfolder to alias (the_vol & "temp")
>set rename_file to alias (the_vol & "rename")
>set destination_file_folder to alias (the_vol & "filer_ut")
>
>set myList to list folder destinationfolder without invisibles
>repeat with myFilename in every item of myList
> set movefile to alias (the_vol & "temp:" & myFilename)
> tell application "Finder"
> set name of file movefile to characters -1 thru -4 of (myFilename)
>as string
> end tell
>end repeat

Maybe your script is not working because you say "file movefile" while "movefile" is already an alias: I would just suppress the "file" term. Then you would add a counter and your script should do the job correctly.

Emmanuel
_______________________________________________
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.

References: 
 >Count and rename files (From: Peter Mathiessen <email@hidden>)

  • Prev by Date: Count and rename files
  • Next by Date: Re: Weird error
  • Previous by thread: Count and rename files
  • Next by thread: Re: Count and rename files
  • Index(es):
    • Date
    • Thread