• 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: TID & text items issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TID & text items issue


  • Subject: Re: TID & text items issue
  • From: "John C. Welch" <email@hidden>
  • Date: Mon, 22 Oct 2012 19:32:38 -0400
  • Thread-topic: TID & text items issue

On 10/22/12 7:07 PM, "Shane Stanley" <email@hidden> wrote:

>On 23/10/2012, at 9:38 AM, John C. Welch <email@hidden> wrote:
>
>>I have a string:
>>"    8    0 0xffffff7f81592000 0x41000    0x41000
>>com.apple.kec.corecrypto (1.0) "
>>I want to strip out the stuff that isn't spaces. Should be easy. Set TIDs
>>to " ", and get every text item. The problem is, I get a listing for the
>>delimiters too, and then I'm in repeat hell.
>>I could SWEAR this used to work better, as in the delimiters didn't get
>>in
>>the list, just the stuff that wasn't delimiters.
>
>It's always worked that way. You can get close to what you want by using
>multiple delimiters:
>
>set x to "    8    0 0xffffff7f81592000 0x41000    0x41000
>com.apple.kec.corecrypto (1.0) "
>set saveTID to AppleScript's text item delimiters
>set AppleScript's text item delimiters to {"    ", "   ", "  ", " "} --
>from most to least order
>set y to text items of x
>set AppleScript's text item delimiters to saveTID
>--> {"", "8", "0", "0xffffff7f81592000", "0x41000", "0x41000",
>"com.apple.kec.corecrypto", "(1.0)", ""}
>
>That still leaves the potential leading and trailing empty string.

that did it! I can just grunt with rest and reverse to strip the trailing
stuff, since that's nicely consistent. Thanks man, I'd have never thought
of that!




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: TID & text items issue (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: TID & text items issue
  • Next by Date: Re: Problem saving a new file
  • Previous by thread: Re: TID & text items issue
  • Next by thread: Re: TID & text items issue
  • Index(es):
    • Date
    • Thread