Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'I only get an error message in return' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
I only get an error message in return
Authored by: invenio on Dec 30, '11 04:10:24AM
When I execute the script I get to the stage where I'm asked whether I want to change the Mod date, Creation date or Both. Selecting say the "Creation date" returns the error message:

error "dateUnixFormat FAILED: Invalid date and time date Thu Jan  1 1970 10:00:00." number -30720 from «script» to item

Events and replies are:

tell application "AppleScript Editor"
	display dialog "Choose a folder of files to change, or file(s)?" buttons {"Cancel", "Folder", "Files"} default button "Files"
		--> {button returned:"Files"}
	choose file with prompt "Choose the file(s) you want to change:" with multiple selections allowed
		--> {alias "Macintosh HD:Users:Mack:Documents:TestFile.txt"}
	display dialog "Change Mod date, Creation date, or Both?" buttons {"Mod", "Creation", "Both"} default button "Both"
		--> {button returned:"Creation"}
end tell
tell current application
	current date
		--> date "Friday, 30 December 2011 11:04:28 PM"
	do shell script "date -r 0 '+%a %b %e %Y %H:%M:%S'"
		--> "Thu Jan  1 1970 10:00:00"
Any idea why?

[ Reply to This | # ]