Change Filename, Keeping Title

Summary: Lets you make changes to the filenames of the selected records without altering any linked titles.
Requires: EagleFiler
Install Location: ~/Library/Scripts/Applications/EagleFiler/
Last Modified: 2019-10-02

Description

If a record’s title and filename (without the extension) are the same, EagleFiler assumes that you want to keep them linked. When you change the filename, EagleFiler automatically makes the corresponding change to the title. This script lets you change the filename while keeping the title as-is. Afterwards, the filename and title will no longer be linked for that record.

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

Script

tell application "EagleFiler"
    
set _records to selected records of browser window 1
    
tell library document 1
        
repeat with _record in _records
            
set _oldFilename to _record's filename
            
repeat
                
set _newFilename to my promptForString("Enter the new filename:", _oldFilename)
                
if _newFilename is not "" then exit repeat
            
end repeat
            
set _title to _record's title
            
set filename of _record to _newFilename
            
set title of _record to _title
        
end repeat
    
end tell
end tell

on promptForString(_prompt, _default)
    
display dialog _prompt default answer _default buttons {"Cancel", "OK"} default button 2
    
return text returned of the result
end promptForString