• 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: list of (more than one) text item delimiters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list of (more than one) text item delimiters


  • Subject: Re: list of (more than one) text item delimiters
  • From: Graff <email@hidden>
  • Date: Tue, 16 Dec 2003 11:36:16 -0500

As others have said you can't use more than one delimiter at a time. That's too bad because I can think of a lot of uses for a list of delimiters.

On an aside, oddly enough using the date class doesn't seem to work correctly with the time "01:23:12.03". When I do:
set theTime to date "01:23:12.03"

It mistakenly converts this to:
"Monday, January 23, 2012 3:00:00 AM"

Obviously it is getting confused and is treating the string as something similar to this:
01.23.12.03

If I remove the .03 like this:
set theTime to date "01:23:12"

I get the much more correct:
Tuesday, December 16, 2003 1:23:12 AM

Perhaps the Date class should be tweaked a little bit to better handle values such as this. I believe that the Date is stored internally as an integer value with a unit of seconds and so the decimal part of the value would probably lost but it probably should still properly handle dates formatted like this by internally rounding or truncating the decimal part.

Oh well, just something else to keep in mind when handling dates and times.

- Ken

On Dec 16, 2003, at 9:42 AM, Brennan wrote:

Is it possible to use more than one text item delimiter at a time, for
example, given the timecode string,

"01:23:12.03"

I'd like to be able to use the delimiters {":", "."} to fish out all the
numerical values in one fell swoop.

set {HH, MM, SS, tt} to text items of myString

If this isn't possible, can someone explain what the thinking is behind
Applescript's text item delimiters being a list?

I can't see that this has any uses whatsoever (unless they were being very
forward looking to a time when it will do what I expect).

Apologies if this has been asked before. Feel free to direct me to an
appropriate archive in lieu of a freshly written answer.

Brennan
_______________________________________________
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.
_______________________________________________
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:
    • Re: list of (more than one) text item delimiters
      • From: Michelle Steiner <email@hidden>
References: 
 >list of (more than one) text item delimiters (From: Brennan <email@hidden>)

  • Prev by Date: Re: list of (more than one) text item delimiters
  • Next by Date: Re: Complex HTML from Safari to Mail
  • Previous by thread: Re: list of (more than one) text item delimiters
  • Next by thread: Re: list of (more than one) text item delimiters
  • Index(es):
    • Date
    • Thread