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: Paul Berkowitz <email@hidden>
- Date: Thu, 23 Mar 2006 07:24:04 -0800
- Thread-topic: Replace slash by underscroe in file name
On 3/23/06 6:48 AM, "kai" <email@hidden> wrote:
> set text item delimiters to storedDelimiters
> -- restore the value of AppleScript's text item delimiters
> -- to whatever they were on entering the subroutine
>
The context of this is that AppleScript's text item delimiters is a true
global across all scripts in your current session of Script Editor or
whatever application is running your script. It's actually a list (because
once upon a time there was the thought that it night be extended to more
than one delimiter) but in fact there can only be one delimiter and it's
never been extended to more than one and isn't likely to be ever.
The default value is {""}. I.e. the default delimiter is "". You need to
reset (restore) AppleScript's text item delimiters so that you aren't left
with "_" between every text item next time you you coerce a list to text in
some other script. Some people (including myself) explicitly reset
AppleScript's text item delimiters to {""} after every replace operation,
just in case some other script has forgotten to reset them. Other people
say, correctly, that it's your responsibility to set AppleScript's text
item delimiters any time you want to coerce a list to text, so it shouldn't
actually matter whether anyone resets them or not after replace. I prefer to
be careful, and always reset them explicitly to {""}.
--
Paul Berkowitz
_______________________________________________
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