Remove Quarantine

Summary: Fixes the selected records so that they can be opened in other apps.
Requires: EagleFiler
Install Location: ~/Library/Scripts/Applications/EagleFiler/
Last Modified: 2020-11-25

Description

Sometimes, transferring a file (often a Web archive) from an other Mac or editing it with a sandboxed application adds a quarantine extended attribute to the file. When you then try to open the file in another application, macOS displays the error message, “[file] cannot be opened because it is from an unidentified developer. macOS cannot verify that this app is free from malware.” This script removes the quarantine xattr so that you can open it in another application from within EagleFiler or by double-clicking it in Finder.

Installation Instructions · 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
        
set _file to _record's file
        
set _path to _file's POSIX path
        
try
            
do shell script "/usr/bin/xattr -d com.apple.quarantine " & _path's quoted form
        
on error _error
            
my logToConsole(_error)
        
end try
    
end repeat
end tell

on logToConsole(_message)
    
set _logMessage to "EagleFiler [Remove Quarantine] " & _message
    
do shell script "/usr/bin/logger -s " & _logMessage's quoted form
end logToConsole