MACSCRPT Archives

June 2013

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:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 28 Jun 2013 12:04:18 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (27 lines)
If you are will to dive into ASOC (Applescript Objective C) aka Cocoa AppleScript the following works.


-- main.scpt
-- Cocoa-AppleScript Applet
--
-- Copyright 2011 {Your Company}. All rights reserved.

-- This is the main script for a Cocoa-AppleScript Applet.
-- You can put the usual script applet handlers here.

property NSString : class "NSString"
property NSDate : class "NSDate"
property NSFileManager : class "NSFileManager"

set afile to "/Users/autox/Desktop/Untitled.scpt"
set afile to NSString's stringWithString_(afile)
set aDate to NSDate's dateWithTimeIntervalSinceNow_((date "Friday, January 1, 1904 12:00:00 AM") - (current date))
set filemanager to NSFileManager's defaultManager()
filemanager's setAttributes_ofItemAtPath_error_({NSFileCreationDate:aDate}, afile, {})


Replace the Date Jan 1, 1904 with whatever date you want to use.


-Mark
Remembers when time began in 1904, now time begins in 1970.

ATOM RSS1 RSS2