-- Replace in Filenames -- https://c-command.com/scripts/eaglefiler/replace-in-filenames -- Summary: Lets you make changes to the filenames of the selected records using find and replace. -- Requires: EagleFiler -- Install Location: ~/Library/Scripts/Applications/EagleFiler/ -- Last Modified: 2019-05-24 tell application "EagleFiler" repeat set theSource to my promptForString("Enter text to find in the filenames:") if theSource is not "" then exit repeat end repeat set the theReplacement to my promptForString("Enter replacement text:") set theRecords to selected records of browser window 1 tell library document 1 repeat with theRecord in theRecords set theName to theRecord's filename set filename of theRecord to my replace(theName, theSource, theReplacement) end repeat end tell end tell on promptForString(thePrompt) display dialog thePrompt default answer "" buttons {"Cancel", "OK"} default button 2 return text returned of the result end promptForString on replace(theString, theSource, theReplacement) set AppleScript's text item delimiters to theSource set theItems to every text item of theString set AppleScript's text item delimiters to theReplacement return theItems as Unicode text end replace