« [Basic] log 内容の確認 | トップページ | [subpathsAtPath]フォルダの内容一覧(最下層まで) »

[contentsOfDirectoryAtPath]フォルダの内容一覧

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
property objMe : a reference to current application
property objNSString : a reference to objMe's NSString
set objFileManager to objMe's NSFileManager's defaultManager()

###デスクトップフォルダのパス
set aliasDirPath to (path to applications folder from local domain) as alias
set strDirPath to POSIX path of aliasDirPath as text

###NSStringテキスト
set objDirPath to objNSString's stringWithString:strDirPath
###ディレクトリのコンテンツ一覧
set arrayFilesList to objFileManager's contentsOfDirectoryAtPath:objDirPath |error|:(missing value)
####
log arrayFilesList
-->«class ocid» id «data optr0000000060FC760100600000»
log arrayFilesList's className() as text
--> array
log arrayFilesList as list
-->リスト形式でアプリケーション一覧が出る

|

« [Basic] log 内容の確認 | トップページ | [subpathsAtPath]フォルダの内容一覧(最下層まで) »

AppleScript NSFileManager」カテゴリの記事