• 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 slash by underscroe in file name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replace slash by underscroe in file name


  • Subject: Re: Replace slash by underscroe in file name
  • From: kai <email@hidden>
  • Date: Thu, 23 Mar 2006 13:18:29 +0000


On 23 Mar 2006, at 13:01, stephan wrote:

I need to process a folder hiearchy and find any file with slash in the name
and replace it by an underscore. So far I know how to process the folder and
get the file name but, I don't know how to replace the slash by something
else.

Here's one way of doing it, Stephan:

-------------

to switchText of t from s to r
	set d to text item delimiters
	set text item delimiters to s
	set t to t's text items
	set text item delimiters to r
	set t to t as Unicode text
	set text item delimiters to d
	t
end switchText

set fileName to "name/of/some/file.txt"
set fileName to my (switchText of fileName from "/" to "_")

--> "name_of_some_file.txt"

-------------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Replace slash by underscroe in file name
      • From: Christopher Nebel <email@hidden>
    • Re: Replace slash by underscroe in file name
      • From: Michelle Steiner <email@hidden>
    • Re: Replace slash by underscroe in file name
      • From: Christian Vinaa <email@hidden>
References: 
 >Replace slash by underscroe in file name (From: stephan <email@hidden>)

  • Prev by Date: Replace slash by underscroe in file name
  • Next by Date: Re: Replace slash by underscroe in file name
  • Previous by thread: Replace slash by underscroe in file name
  • Next by thread: Re: Replace slash by underscroe in file name
  • Index(es):
    • Date
    • Thread