Re: Replace slash by underscroe in file name
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