Change the date sort order in FolderOrg X

Feb 20, '04 09:04:00AM

Contributed by: cclauset

Doug Everly has updated his incredibly useful FolderOrg X folder action script (previously discussed in this hint) for compatibility with Safari 1.2, but I prefer to keep my folder organized by the international yyyy-mm-dd format instead of the default January 1 2003 format. Since the script is fully editable, open it with your favorite AppleScript editor and change this (shown as three lines here; not necessarily that way in the code):


  -- format date for folder's name (in January 1 2003 format)
  copy word 2 of ((current date) as text) & " " & word 3 of ¬
  ((current date) as text) & " " & word 4 of ((current date) ¬
  as text) to the_date
to this:

   -- format date for folder's name (in yyyy-mm-dd format)
   copy ((offset of (the month of (current date)) in ¬
    "jan feb mar apr may jun jul aug sep oct nov dec ") + 3) / 4 ¬
    as integer to mo
   if mo < 10 then copy "0" & mo as text to mo
   copy day of (current date) to da
   if (day of (current date) < 10) then copy "0" & da as text to da
   copy (year of (current date) as text) & "-" & mo & "-" & da to the_date
Then save your changes.

Disclaimer: the yyyy-mm-dd code was written by Ben Lawson for the AppleScript This Week: Cool Code page. I just put it to use...

Comments (4)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040212081529156