AppleScript名:指定ファイルのxattrの削除(ダウンロードしたファイルが開けないときに) |
use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "XAttribute" –https://github.com/rylio/OTMXAttribute set dlFullPath to POSIX path of (choose file) set xRes to removeXAttrFromFile(dlFullPath, "com.apple.quarantine") on removeXAttrFromFile(aFile, anXattr) –Get Xattr String set anAttribute to (current application’s OTMXAttribute’s stringAttributeAtPath:aFile |name|:anXattr |error|:(missing value)) if anAttribute = missing value then return true –There is no use to remove xattr –Remove Xattr set xRes to (current application’s OTMXAttribute’s removeAttributeAtPath:aFile |name|:anXattr |error|:(missing value)) if xRes = missing value then return false return (xRes as boolean) end removeXAttrFromFile |
More from my site
(Visited 86 times, 1 visits today)