• 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: Quickie Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quickie Question


  • Subject: Re: Quickie Question
  • From: Chuck Ross <email@hidden>
  • Date: Sat, 30 Mar 2002 02:17:20 -0800

Now if only someone would come up with a vanilla way to obtain
the month as an integer, right Emmanuel? ;-)

I saw something like this once. I can't be sure, but I think it was done by Matt Petrowski as a FileMaker Pro calc, but I could be wrong. I just remembered the basic technique and translated it to AppleScript. If by "vanilla" you mean we can use the standard scripting additions, then this should work.

set theDate to current date
set monthNum to ((((offset of ((characters 1 thru 3 of ((month of theDate) as string))
as string) in "JanFebMarAprMayJunJulAugSepOctNovDec") - 1) / 3) + 1) as integer

Chuck
--
Charles E. Ross
Database/Application Developer
(661) 943-9169
fax: (253) 663-0082
email@hidden
_______________________________________________
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: Quickie Question
      • From: Sander Tekelenburg <email@hidden>
References: 
 >Re: Quickie Question (From: Arthur J Knapp <email@hidden>)

  • Prev by Date: Re: Random Numbers (is new: Seeding)
  • Next by Date: Re: Error-trapping alias properties
  • Previous by thread: Re: Quickie Question
  • Next by thread: Re: Quickie Question
  • Index(es):
    • Date
    • Thread