Folder Actions

I thought folder actions would be a useful way to get more flexibility in naming captured items and in sending them to apppropriate EF libraries. My first attempt just wants to send a file saved to a action folder to the front library in EF, but it is not working. Any suggestions?

on adding folder items to this_folder after receiving these_items
    tell application "Finder"
        set this_file to item 1 of these_items
    end tell
    tell application "EagleFiler"
        tell library document 1
            import files {this_file}
        end tell
    end tell
end adding folder items to

This works for me:

on adding folder items to this_folder after receiving added_items
    tell application "Finder"
        repeat with a_file in added_items
            tell application "EagleFiler"
                tell library document 1
                    import files {a_file}
                end tell
            end tell
        end repeat
    end tell
end adding folder items to

How would you modify this to put the file in a particular folder in eagleflier?..or would that be beyond the scope of what a folder action could do?

There’s not currently a good way to import into a particular folder via AppleScript. I will be addressing this in the next version.

As of EagleFiler 1.2, you can write something like:


set theFolder to library record "MyFolder" of root folder
import files {a_file} container theFolder