-- Downloaded From: http://c-command.com/scripts/eaglefiler/duplicate-records -- Last Modified: 2010-11-27 tell application "EagleFiler" set theSelection to selected records of window 1 tell library document 1 repeat with theTemplate in theSelection set theFile to theTemplate's file set thePath to POSIX path of theFile set theName to do shell script "basename " & thePath's quoted form set tempFolder to do shell script "mktemp -d -t 'EFDuplicateRecord'" set tempPath to tempFolder & "/" & theName do shell script "cp -Rp " & thePath's quoted form & " " & tempPath's quoted form set tempFile to tempPath as POSIX file set theContainer to theTemplate's container set theTags to theTemplate's assigned tags set theTagNames to {} repeat with theTag in theTags copy theTag's name to end of theTagNames end repeat set theNote to note text of theTemplate import files {tempFile} tag names theTagNames note theNote container theContainer end repeat end tell end tell