• 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: making a new folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: making a new folder


  • Subject: Re: making a new folder
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 2 Aug 2002 18:33:01 -0700

On Friday, August 2, 2002, at 07:37 AM, Michael Grant wrote:

On 8/1/02 5:29 PM, "Bill Briggs" <email@hidden> wrote:

set {d, m, y} to {day, month, year} of todaysDate
set monthList to {January, February, March, April, May, ,
June, July, August, September, October, November, ,
December}
repeat with i from 1 to 12
if m = (item i of monthList) then

I've had lots of trouble with the 'month' keyword, which seems to come out
'jul' when I'm expecting 'July' and vice versa. (I read in one of the older
books, Goodman I think but I'm too lazy to look it up again now, that it's
not actually a string and can't be coerced to one--of course that may be
obsolete information.) What does work consistently is looping through the
month list and testing if that month is in the date string.

1. Notice that Bill's script doesn't have the month names in quotes -- those are enumerators, not strings.

2. That bit of Goodman became obsolete in AppleScript 1.4 -- enumerators can be coerced to strings, though it doesn't work reliably with application-defined ones. (That is, it's perfectly reliable *if* you pull certain peculiar stunts; otherwise it tends to only work in Script Editor.)

3. Even though enumerators can be coerced to strings, it doesn't doesn't always happen automatically, notably when calling scripting additions. For instance, if you say "display dialog July" (notice no quotes around July), you'll see "jul", which is the underlying code. If you say "display dialog (July as string)", you'll get "July".

4. Tests like '"July" is in (current date as string)' will fail on non-English systems. If your script is purely for your own use, then don't worry about it, but if you plan to distribute it, foreign users may get annoyed.


--Chris Nebel
AppleScript Engineering
_______________________________________________
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: making a new folder
      • From: John W Baxter <email@hidden>
    • Re: making a new folder
      • From: Michael Grant <email@hidden>
References: 
 >Re: making a new folder (From: Michael Grant <email@hidden>)

  • Prev by Date: Re: Why root?
  • Next by Date: Re: Trim?
  • Previous by thread: Re: making a new folder
  • Next by thread: Re: making a new folder
  • Index(es):
    • Date
    • Thread