Thanks for RSVP.
Just to be clear, I have multiple files on the desktop and only one file title is formatted as weekday.png.
To be clear again, it will NEVER be "weekday.png"... weekday will ALWAYS be the name of the current weekday when script is ran last. So, if the script was run on Monday and not run till Wednesday, it will remain Monday.png
This file will ALWAYS be Monday.png, Tuesday.png etc. So, if it were ran now and it said Tuesday.png, it would change to Wednesday.png. If it were Wednesday.png and the script ran, it would remain Wednesday.png.
There is a file Saturday.png on the desktop.
There is also a file 1.docx on the desktop among many other files
I will call the scripts ONE TWO AND THREE
ONE This script appears to do nothing to files on the desktop
set _today to (weekday of (current date)) as text
set _yesterday to (weekday of ((current date) - 1 * days)) as text
tell application "Finder"
try
set f to first file of (path to desktop) whose name begins with _yesterday
set ext to name extension of f
set name of f to _today & "." & ext
end try
end tell
TWO This script changes only the 1.docx filename to Wednesday.docx
set _today to (weekday of (current date)) as text
tell application "Finder"
set f to first file of (path to desktop)
set ext to name extension of f
set name of f to _today & "." & ext
end tell
THREE this script appears to do nothing on desktop
set dayNames to {}
repeat with i from 0 to 6
set dayNames to dayNames & (weekday of ((current date) - (i * days)) as text)
end repeat
set _today to (weekday of (current date)) as text
tell application "Finder"
set f to first file of (path to desktop)
if word 1 of ((name of f) as text) is in dayNames then
set ext to name extension of f
set name of f to _today & "." & ext
end if
end tell
To answer your questions.
I answered above how the scripts are not working, which may very well have to do with me and not being precise enough
ALL scripts run without any errors
Please don't hesitate to ask anything I didn't answer.
Once again, thanks for your help