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: Christian Vinaa <email@hidden>
- Date: Thu, 23 Mar 2006 15:06:58 +0100
At 13:18 +0000 23/03/2006, kai wrote:
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
perhaps i am dense but Kai;
would you please explain what in fact is going on behind the scene
in the switchtext rutine ?
I simply dont get it ! ;-)
--
Christian Vinaa
...... Meanwhile, aunt Martha, having taken a tramp in the woods,
is lying in a ditch at the edge of town .........................
_______________________________________________
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