Append Current Date to Filename

Summary: Renames the selected records with the current date at the end of the filename.
Requires: EagleFiler
Install Location: ~/Library/Scripts/Applications/EagleFiler/
Last Modified: 2026-02-10

Description

This adds the current date (in the format yyyy-mm-dd) to the end of the selected records’ filenames.

Installation Instructions · Download in Compiled Format · Download in Text Format

Script

use AppleScript version "2.4"
use
framework "Foundation"
use
scripting additions

tell
application "EagleFiler"
    set
_records to selected records of browser window 1
    repeat with
_record in _records
        set
_dateString to my stringFromDate(current date)
        set
_record's basename to _record's basename & " " & _dateString
    end repeat
end tell

on
stringFromDate(_date)
    set
_formatter to current application's NSDateFormatter's alloc's init
    
_formatter's setDateFormat:"yyyy-MM-dd"
    return
_formatter's stringFromDate:_date
end
stringFromDate