I’m having some trouble converting some AS date manipulation bits to ASOC.
I grab some dates from the info for some files, using this:
tell application "Finder"
set theInfo to info for (anItem as alias)
set theCreationDate to creation date of theInfo as string
set theModificationDate to modification date of theInfo as string
set theComment to get comment of (anItem as alias)
end tell
And am trying to pull the time out of those date strings using this:
set workTime to time string of date theCreationDate
again, the Finder knows all information, info for is not needed
Why not
set anItem to anItem as alias
tell application "Finder"
set theCreationDate to creation date of anItem
set theModificationDate to modification date of anItem
set theComment to comment of anItem
end tell
set workTime to time string of theCreationDate
Unfortunately the Time String code still throws this error:
2012-02-10 09:45:37.101 Automator[5227:7903] *** -[CS5_Render runWithInput:fromAction:error:]: Can't get time string of "Tuesday, February 7, 2012 9:39:16 AM". (error -1728)