[fileExistsAtPath]フォルダの有無
#!/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()
######################
###調べるフォルダのパス
###Adobe Acrobat Readerのパス.appはフォルダ?
set strDirPath to "/Applications/Adobe Acrobat Reader DC.app" as text
set objDirPath to objNSString's stringWithString:strDirPath
###ファイル・フォルダの有無
set boolFolderExists to (objFileManager's fileExistsAtPath:objDirPath isDirectory:true)
log boolFolderExists
-->true or false
if boolFolderExists is true then
log "リーダーはインストール済み"
else
log "リーダーは未インストール"
end if
| 固定リンク
「NSFileManager」カテゴリの記事
- iCloud driveの書類を開く(2024.10.17)
- ファイルのある親フォルダ名をファイル名にする(2024.09.13)
- [contentsOfDirectoryAtURL]コンテンツURLの収集 第一階層のみ(2024.09.02)
- [Skitch]キャッシュをゴミ箱に入れる(2023.11.11)
- [NSFileManager]ファイルのコピー (Acrobatのスタンプデータのバックアップを作成する)(2023.10.20)