シンボリックリンクのUTIの取得
AppleScript サンプルコード
行番号 | ソース |
---|---|
001 | #!/usr/bin/env osascript |
002 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
003 | # |
004 | #com.cocolog-nifty.quicktimer.icefloe |
005 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
006 | use AppleScript version "2.8" |
007 | use framework "Foundation" |
008 | use framework "UniformTypeIdentifiers" |
009 | use framework "AppKit" |
010 | use scripting additions |
011 | property refMe : a reference to current application |
012 | |
013 | |
014 | #シンボリックリンク |
015 | set strFilePath to ("/Library/Fonts/Arial Unicode.ttf") as text |
016 | #パスURL |
017 | set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath) |
018 | set ocidFilePath to ocidFilePathStr's stringByStandardizingPath() |
019 | set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false) |
020 | |
021 | #UTIの取得 |
022 | set listResponse to (ocidFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLContentTypeKey) |error| :(reference)) |
023 | set ocidUTType to (item 2 of listResponse) |
024 | set strSymLinkUTI to ocidUTType's identifier() as text |
025 | |
026 | return strSymLinkUTI |
AppleScriptで生成しました |
| 固定リンク
「UTType」カテゴリの記事
- シンボリックリンクのUTIの取得(2024.12.02)
- [UTType]処理対象のUTI(ファイルタイプ)か?チェックする 複数UTIでチェックする(2024.10.03)
- [UTType]処理対象のUTI(ファイルタイプ)か?チェックする(2024.09.30)
- UTI(uniform type identifier)の取得 ツリー構造付き 少し修正(2024.06.19)
- UTI(uniform type identifier)の取得 ツリー構造付き(2024.05.23)