• 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: Parsing quoted text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing quoted text


  • Subject: Re: Parsing quoted text
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 27 Sep 2006 12:25:51 +0200


Le 27 sept. 2006 à 12:17, T&B a écrit :

Hi Yvan,

And now a shorter one using some complementary handlers.

property sticky : ASCII character (202)
set textBlock to "item1  item2    'item 3'  [item 4]"
set delimiter to " "
set quotePairList to {{quote, quote}, {"'", "'"}, {"[", "]"}} --

set textBlock to normalize(textBlock, quotePairList)

set liste to spaces2space(textBlock)

Thanks for your efforts. This script seems much better, but still has a few bugs, I think, such as these results:


set textBlock to "item1 item2 'item 3' [item 4]" -- ie your script's test
--> {"item1", "item2", "", "item 3", "item 4"}


But should be:
--> {"item1", "item2", "item 3", "item 4"}

And this test:
set textBlock to "item1"
--> {"i", "t", "e", "m", "1"}
But should be:
--> {"item1"}

and this:
set textBlock to "item1  'item[2]'"
--> {"item1", "item2"}
But should be:
--> {"item1", "item[2]"}


For the late one I was aware, this is why I asked if 'item[2]' was allowed in the entry data.

I didn't take care of the two first ;-((

Yvan KOENIG _______________________________________________
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


References: 
 >Parsing quoted text (From: T&B <email@hidden>)
 >Re: Parsing quoted text (From: Yvan KOENIG <email@hidden>)
 >Re: Parsing quoted text (From: T&B <email@hidden>)
 >Re: Parsing quoted text (From: Yvan KOENIG <email@hidden>)
 >Re: Parsing quoted text (From: T&B <email@hidden>)

  • Prev by Date: Re: New to applescript: year of
  • Next by Date: Re: Calling a property by using a string
  • Previous by thread: Re: Parsing quoted text
  • Next by thread: Re: Parsing quoted text
  • Index(es):
    • Date
    • Thread