Reload Web Pages

Summary: Updates the selected records with the latest Web content.
Requires: EagleFiler
Install Location: ~/Library/Scripts/Applications/EagleFiler/

Description

This script downloads fresh copies of the selected records’ Web pages and moves the old files to the trash.

Download in Compiled Format · Download in Text Format

Script

tell application "EagleFiler"
    
set _records to selected records of browser window 1
    
repeat with _record in _records
        
my reloadWebPage(_record)
    
end repeat
end tell

on reloadWebPage(_record)
    
tell application "EagleFiler"
        
set _url to _record's source URL
        
set _container to _record's container
        
tell _record's library document to import URLs {_url}
        
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 reloadWebPage

on copyMetadata(_source, _dest)
    
tell application "EagleFiler"
        
set note text of _dest to _source's note text
        
set _tags to _source's assigned tags
        
set assigned tags of _dest to _tags
        
set title of _dest to _source's title
        
set label index of _dest to _source's label index
    
end tell
end copyMetadata

Last Modified: 2010-11-27

Running the Script

You can use AppleScript Editor (AppleScript Utility prior to Mac OS X 10.6) to enable Mac OS X’s built-in Script menu. To run the script, just select it from the menu. FastScripts provides a similar menu that supports keyboard shortcuts and other features.