« [Finder]エイリアスの参照元の取得 | トップページ | エイリアス・シンボリックリンクの参照元の取得 »

シンボリックリンクのUTIの取得


AppleScript サンプルコード

【スクリプトエディタで開く】 |

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
006use AppleScript version "2.8"
007use framework "Foundation"
008use framework "UniformTypeIdentifiers"
009use framework "AppKit"
010use scripting additions
011property refMe : a reference to current application
012
013
014#シンボリックリンク
015set strFilePath to ("/Library/Fonts/Arial Unicode.ttf") as text
016#パスURL
017set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath)
018set ocidFilePath to ocidFilePathStr's stringByStandardizingPath()
019set ocidFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:false)
020
021#UTIの取得
022set listResponse to (ocidFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLContentTypeKey) |error| :(reference))
023set ocidUTType to (item 2 of listResponse)
024set strSymLinkUTI to ocidUTType's identifier() as text
025
026return strSymLinkUTI
AppleScriptで生成しました

|

« [Finder]エイリアスの参照元の取得 | トップページ | エイリアス・シンボリックリンクの参照元の取得 »

UTType」カテゴリの記事