C-Command Software Forum

Filename-to-Title and Dates

If I apply Filename-to-Title script, some records’ “Date Modified” changes to the current date, which destroys valuable information. Is this avoidable?

Here’s a modified script that will not change the modification date:

tell application "EagleFiler"
    set _records to selected records of browser window 1
    repeat with _record in _records
        set _date to _record's modification date
        set _record's title to ""
        set _alias to _record's file as alias
        tell application "Finder"
            set _file to file _alias
            set _file's modification date to _date
        end tell
    end repeat
end tell

(The date may appear to change in EagleFiler, but if you wait a while or close and re-open the library it will pick up the new date from the filesystem.)

The revised script
The revised script works, thanks.