Import Examples

Summary: Imports files, URLs, and text with various options.
Requires: EagleFiler
Install Location: ~/Library/Scripts/Applications/EagleFiler/
Last Modified: 2016-11-21

Description

This script show different ways to get your information into EagleFiler’s frontmost library via AppleScript.

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

Script

tell application "EagleFiler"
    
tell library document 1
        
-- import a file into a particular folder, and add a note
        
set theFolder to library record "MyFolder" of root folder
        
set thePath to "/Users/mjt/Desktop/MyFile"
        
set theNote to "This file was on the desktop."
        
import files {POSIX file thePath} container theFolder note theNote
        
        
-- import URLs, creating Web archives and adding tags
        
import URLs {"http://www.apple.com", "http://c-command.com"} tag names {"mac", "software"}
        
        
-- import text, creating a new RTFD file
        
import text "This is a test."
        
        
-- Import whatever’s on the clipboard (e.g. text, rich text, or image)
        
import with clipboard
    
end tell
end tell


-- Save the script as an application (e.g. “Save PDF to MyFolder.app”) and put it in:
-- /Users/<username>/Library/PDF Services/
-- Then when you print from any application you can choose “Save PDF to MyFolder”
-- to create a new PDF file in that folder in EagleFiler.
on open _files
    
tell application "EagleFiler"
        
tell library document 1
            
set _folder to library record "MyFolder" of root folder
            
import files _files container _folder
        
end tell
    
end tell
end open