I’m trying to replicate a facility in DevonThink that I miss in EF: the ability to highlight a string in a library document and set it as the title of the library record ('Set Title As…" in DT).
But I’m not much of a scripter. The script below works most of the time. I’m sure several Forum users could do this a lot better.
The ‘clean up’ sub-routine eliminates CRs and multiple spaces from the titles of PDF files.
-- EagleFiler (v. 1.2) Script -- Set the Title of the currently selected record -- to the string highlighted in the record viewer -- No rights claimed. Your mileage may vary. -- --- Replace non-alphanum and non-punctuation chrs --- on clipboard with spaces and concatenate on cleanup() set myScript to ("usr/bin/pbpaste | tr -Csu ':alnum:]:punct:]' ' ' | pbcopy") do shell script (myScript) end cleanup --- Title string should be selected in the viewer --- or in any frontmost window before running. --- Will set the Title of all records higlighted --- in the library window; selecting just one --- record is recommended ;-) tell application "EagleFiler" set the clipboard to "" tell application "System Events" keystroke "c" using command down end tell tell me to cleanup() set newClip to the clipboard -- as text set theRecords to the selected records of browser window 1 repeat with theRecord in theRecords set theRecord's title to newClip end repeat end tell -- -- ends --