MACSCRPT Archives

September 2009

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Nigel Garvey <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 23 Sep 2009 14:01:53 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (22 lines)
Shane Stanley wrote on Wed, 23 Sep 2009 08:45:40 +1000:

>FWIW, the unit-conversion hack still works in Snow Leopard:
>
>property zdate : date "Monday, August 10, 1992 11:00:00 AM"
>set file_name to ((current date) - zdate as feet as text) & ".html"

Slightly less of a hack and faster:

  property zdate : date "Monday 10 August 1992 11:00:00"
  
  tell (current date) - zdate
    set file_name to ((it div 100000000) as text) & (it mod 100000000 div
1) & ".html"
  end tell

Obviously this assumes that (current date) - date "Monday 10 August
1992 11:00:00" will never again be less than 100000000, but that seems a
fairly safe bet.

NG

ATOM RSS1 RSS2