Script - Operation not permitted number 1
I have a script (below) that I use to change the date created and date modified dates of files when I work on videos. It is not working under the latest version of macOS (granted, I dont know the last time it did work - it has been a while since I used it).
I granted Terminal, Script Editor and Automator Full Disk Access. Still, I can't get it going. Thoughts?
The error is:
Operation not permitted" number 1
The script is:
tell application "Finder"
set FileList to selection
repeat with theFile in FileList
set fileName to name of theFile
set filePath to quoted form of (POSIX path of (theFile as alias))
set crYear to text 1 thru 4 of fileName
set crMonth to text 6 thru 7 of fileName
set crDay to text 9 thru 10 of fileName
set crHours to "00"
set crMins to "00"
set crDate to crYear & crMonth & crDay & crHours & crMins
set shellString to "touch -t " & crDate & " " & filePath
set shellString to "touch -mt " & crDate & " " & filePath
do shell script shellString with administrator privileges
end repeat
end tell
Mac Studio