I’m close now to getting what I need. This is the script I am using. At the line that says "set title to theTitle, it works if I ask it to SAY the result (filename & date) but if I try to SET anything from the result I get an error message “Can’t make «class DTda» of application “DEVONagent” into type text.”.
I tried Title, Name, Summary, even URL as places to SET to the new name.
I tried REFORMAT DATE to TEXT but that couldn’t be done either. Is there any way to add the date to the filename as text?
on results(theResults, theSet, theQuery)
tell application "DEVONagent"
set pathToApp to (path to application id "com.devon-technologies.agent" as string)
set pathToAdditions to (pathToApp & "Contents:Resources:Script Additions.scpt") as alias
set helperLibrary to load script pathToAdditions
if not (exists search window 1) then error "No search window is open."
set theSearch to search window 1
if searching of theSearch then error "Search is not yet complete."
set theResults to search results of theSearch
repeat with theresult in theResults
set theTitle to title of theresult
reformat date as text
set thedate to date of the result as text
set theTitle to theTitle & date as string
set title to theTitle
on error error_message number error_number
display alert "DEVONagent" message error_message as warning