Import From Specified Folders

Summary: Imports files from certain folders and then deletes them.
Requires: EagleFiler
Install Location: ~/Library/Scripts/Applications/EagleFiler/
Last Modified: 2020-09-10

Description

EagleFiler normally watches the library’s To Import folder and Files folder and imports new files added to them. This script lets you add files to other folders, which are not part of the library. When you run the script, EagleFiler imports the files in those folders and then deletes them (so that the folders remain but are empty).

Installation Instructions · Download in Compiled Format · Download in Text Format

Script

on run
    
my importFolderContents("/Volumes/NetworkDrive/FolderA")
    
my importFolderContents("/Volumes/NetworkDrive/FolderB")
end run

on importFolderContents(_folderPath)
    
tell application "EagleFiler"
        
import files my listFolderPath(_folderPath) with deleting afterwards
    
end tell
end importFolderContents

on listFolderPath(_folderPath)
    
set _posixFile to POSIX file _folderPath
    
tell application "Finder"
        
return files of folder _posixFile as alias list
    
end tell
end listFolderPath