• 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: Coping with Date format variations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coping with Date format variations


  • Subject: Re: Coping with Date format variations
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 24 May 2010 21:49:20 -0700

On May 24, 2010, at 8:22 PM, Robert Poland wrote:

As noticed by others the handler is used several times so that's why the text item delimiters were done that way. 

That introduces another potential problem; if you're going to use text item delimiters in other handlers, there may be a conflict.

Also, you might think about passing all the parameters at once, so the handler is called only once, and loops within the handler.

set WakeUpTimes to {"6:31", "8:49", "7:13", "3:26"}
set WakeUpTimes to my decoupe(WakeUpTimes)

on decoupe(tees) -- t = time
set output to {}
set AppleScript's text item delimiters to ":"
repeat with t in tees
set {h, m} to text items of t
copy ((m as integer) + ((h as integer) * 60)) * 60 to end of output
end repeat
set AppleScript's text item delimiters to "" -- restore
return output
end decoupe

Then you can process each item of the returned list.

-- Michelle

--
Do not go out and kill Klansmen, no matter how much they deserve it. It would be funny as hell to see on the evening news how a bunch of guys wearing bright pink robes and hoods started burning triangles in their yards for a change.


 _______________________________________________
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

  • Follow-Ups:
    • Re: Coping with Date format variations
      • From: Robert Poland <email@hidden>
References: 
 >Re: Coping with Date format variations (From: Shane Stanley <email@hidden>)
 >Re: Coping with Date format variations (From: Luther Fuller <email@hidden>)
 >Re: Coping with Date format variations (From: "Mark J. Reed" <email@hidden>)
 >Re: Coping with Date format variations (From: LuKreme <email@hidden>)
 >Re: Coping with Date format variations (From: "Mark J. Reed" <email@hidden>)
 >Re: Coping with Date format variations (From: Luther Fuller <email@hidden>)
 >Re: Coping with Date format variations (From: Robert Poland <email@hidden>)
 >Re: Coping with Date format variations (From: Michelle Steiner <email@hidden>)
 >Re: Coping with Date format variations (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Coping with Date format variations
  • Next by Date: Re: Coping with Date format variations
  • Previous by thread: Re: Coping with Date format variations
  • Next by thread: Re: Coping with Date format variations
  • Index(es):
    • Date
    • Thread