• 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: TIDs case insensitive?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TIDs case insensitive?


  • Subject: Re: TIDs case insensitive?
  • From: Bill Briggs <email@hidden>
  • Date: Tue, 6 Mar 2001 16:24:34 -0400

At 9:32 AM -0800 06/03/01, Chris Nebel wrote:
> I just found to my great dispair that TIDs are case sensitive. Is there a way to make them insensitive? - no, not ignoring case, I just tried...
I use TIDs for fast substring replacements. If I cant' make them case insensitive, I will have to use more traditional and less efficient search/replace.

Sorry, it's a known problem with no workaround in plain AppleScript.

Don't apologize. It can actually be useful. I wouldn't want that fixed if it meant that an "A" was no longer just an "A", but could be an "a" as well. IMHO it would be better that they stay strict character designations. What Serge wants to do is a job for GREP.



Most people don't notice because their delimiters are all punctuation.

But a script like this would break if it was case insensitive. And it's a lot faster way of doing something like this than going about an ASCII character mapping (and is easier to program where the Majiscule/Miniscule forms are in non-english alphabets that don't have neat mappings for letters with diacritical marks).

set xMay to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
set xMin to "abcdefghijklmnopqrstuvwxyz"
set capVar to "ThisIsTheSampleStringToBeTransformed"
set astid to AppleScript's text item delimiters
considering case
repeat with xChar from 1 to length of xMay
set AppleScript's text item delimiters to ,
{"" & item xChar of xMay}
set capVar to text items of capVar
set AppleScript's text item delimiters to ,
{"_" & item xChar of xMin}
set capVar to capVar as string
end repeat
set newVar to capVar
set AppleScript's text item delimiters to astid
end considering
newVar


Please don't make Text item delimiters case insensitive. I think they are more useful the way they are. Something that *would* be useful is to have multiple defined TIDs actually working.

- web


  • Follow-Ups:
    • Re: TIDs case insensitive?
      • From: Paul Berkowitz <email@hidden>
    • Re: TIDs case insensitive?
      • From: Chris Nebel <email@hidden>
References: 
 >Masters in AppleScript for multimedia (From: "Jeff Handy" <email@hidden>)
 >TIDs case insensitive? (From: "Serge Belleudy-d'Espinose" <email@hidden>)
 >Re: TIDs case insensitive? (From: Chris Nebel <email@hidden>)

  • Prev by Date: Re: Where is the Searchable Applescript-users Archive?
  • Next by Date: Please move this discussion
  • Previous by thread: Re: TIDs case insensitive?
  • Next by thread: Re: TIDs case insensitive?
  • Index(es):
    • Date
    • Thread