I need to be able to tag files outside EagleFiler (Gravity Applications “Tags” and IronicSoftware “Leap” make setting tags and finding tagged files again so much more convenient than EagleFiler). But EagleFiler has to stay in sync somehow (all my other apps manage this automatically, I don’t know why EagleFiler doesn’t).
I’ve seen this question, modified this script, and produced this:
tell application "EagleFiler"
set _records to selected records of browser window 1
repeat with _record in _records
my reloadFile(_record)
end repeat
end tell
on reloadFile(_record)
tell application "EagleFiler"
set _file to _record's file -- ? need to point to the file
set _container to _record's container
tell _record's library document to import files {_file}
set _newRecord to item 1 of the result
set _trash to trash of _record's library document
set _record's container to _trash
set _newRecord's container to _container
my copyMetadata(_record, _newRecord)
end tell
end reloadFile
on copyMetadata(_source, _dest)
tell application "EagleFiler"
set _tags to _source's assigned tags
set assigned tags of _dest to _tags
end tell
end copyMetadata
but it doesn’t work, telling me error “Can’t get item 1 of {}.” number -1728 from item 1 of {} when it gets to set _newRecord to item 1 of the result.
The EagleScript “Errors” window shows the file getting loaded, but the error comes up that “This file is already in the EagleFiler library”, although I have allowed duplicates in Preferences.
Any reason why I should be getting this error?