• 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: Why save text item delimiters? Philosophical question....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why save text item delimiters? Philosophical question....


  • Subject: Re: Why save text item delimiters? Philosophical question....
  • From: John Delacour <email@hidden>
  • Date: Mon, 16 Jun 2003 23:50:06 +0100
  • Mac-eudora-version: 6.0b20

At 3:01 pm -0400 16/6/03, Gary Lists wrote:

I am a JD-style user: always set them in the line before I need them.

Never had a problem.


If I have a script that requires a lot of splitting and joining, I add stock handlers to avoid the noise. I just hate those verbose scripts that appear so often on this list where you have to plough through line after line of "set oldDelimiters to Applescript's text item delimiters". It was Sal's crowd that started this nonsense and a whole lot more.


replaceXY("hello", "e", "u")

on splitString(_string, _cut)
set my text item delimiters to _cut
set ls to text items of _string
set my text item delimiters to ""
return ls
end splitString

on joinItems(_items, _glue)
set my text item delimiters to _glue
set s to _items as string
set my text item delimiters to ""
return s
end joinItems

on replaceXY(_string, x, y)
set ls to splitString(_string, x)
set s to joinItems(ls, y)
end replaceXY
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • A script to create another script
      • From: Joseph Weaks <email@hidden>
    • Re: Why save text item delimiters? Philosophical question....
      • From: Malcolm Fitzgerald <email@hidden>
References: 
 >Re: Why save text item delimiters? Philosophical question.... (From: Gary Lists <email@hidden>)

  • Prev by Date: Re: Why save text item delimiters? Philosophical question....
  • Next by Date: Shell scripts & vars
  • Previous by thread: Re: Why save text item delimiters? Philosophical question....
  • Next by thread: Re: Why save text item delimiters? Philosophical question....
  • Index(es):
    • Date
    • Thread