• 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: Replace characters in filename
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replace characters in filename


  • Subject: Re: Replace characters in filename
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 12 Jun 2004 17:31:05 -0500

At 16:51 -0400 06/12/2004, Graff wrought:

How would I find certain characters (any of a list of 13) in a filename and replace them with one common character?
...
property disallowedCharacters : "1234567890ABCD"
property replacementCharacter : "!"

I thought I'd throw in a plug for the Satimage osax's regular expressions.

set someFileName to "aGraphicsFile001A.jpg"
set newFileName to change "[0-9ABCD]" into "" in someFileName with regexp and case sensitive

--> aGraphicsFile.jpg


Chris
_______________________________________________
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: Replace characters in filename
      • From: Graff <email@hidden>
References: 
 >Replace characters in filename (From: Rick Davis <email@hidden>)
 >Re: Replace characters in filename (From: Graff <email@hidden>)

  • Prev by Date: Re: Hardware Mac Address -RESEND
  • Next by Date: Re: Saving SE dictionaries
  • Previous by thread: Re: Replace characters in filename
  • Next by thread: Re: Replace characters in filename
  • Index(es):
    • Date
    • Thread