tell application "Finder" copy selection to selectedItems if ((count of selectedItems) ≠ 0) then repeat with selectedItem in selectedItems set file type of file (selectedItem as alias) to "TEXT" set p to quoted form of (POSIX path of (selectedItem as alias)) as string do shell script ("qlmanage -p " & p) end repeat end if end tell