Copy File URL
Summary: Copies file:// URLs for the selected records to the clipboard.
Requires: EagleFiler
Install Location: ~/Library/Scripts/Applications/EagleFiler/
Description
This can be used, e.g, for pasting into a calendar program. Clicking a file:// link will open the file as if it were double-clicked in the Finder. The Copy Record Link command, in contrast, copies an x-eaglefiler:// link that will open the file in EagleFiler.
Download in Compiled Format · Download in Text Format
Script
tell application "EagleFiler"
set _records to selected records of browser window 1
set _lines to {}
repeat with _record in _records
set _file to _record's file
set _path to _file's POSIX path
copy my urlFromPath(_path) to end of _lines
end repeat
set AppleScript's text item delimiters to return
set _text to _lines as text
set the clipboard to _text
end tell
on urlFromPath(_path)
return do shell script "/usr/bin/python -c 'from Foundation import NSURL; import sys; s = unicode(sys.argv[1], \"utf-8\"); print NSURL.fileURLWithPath_(s) ' " & _path's quoted form
end urlFromPathLast Modified: 2012-02-09
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.