my files in the Inbox are named YYYY-MM-DD. So I wanted to setup an apple script to change the creation date to DD.MM.YYYY.
After some search I wrote together the following one:
repeat with thisRecord in (selection as list)
set pDate to current date set recordName to (name of thisRecord) set titleDatestring to (characters 1 thru 10 of recordName) as text set myYear to (characters 1 thru 4 of titleDatestring) as text set myMonth to (characters 6 thru 7 of titleDatestring) as text set myDay to (characters 9 thru 10 of titleDatestring) as text set myDay to day of pDate set myMonth to month of pDate set myYear to year of pDate set time of pDate to "0" set the creation date of thisRecord to pDate
Even though I (at least I believe I did replaced the pDate (which was introced with the current date) with the “right” date, day, month and year are ignored. Only the time is correctly adjusted to 0.
What am I doing wrong?
Thank you for your support,