[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()
######################
###調べるファイルのパス
###Acrobat info.plistのパス
set strFilePath to "/Applications/Adobe Acrobat DC/Adobe Acrobat.app/Contents/Info.plist" as text
set objFilePath to objNSString's stringWithString:strFilePath
###ファイルの有無を調べる
set boolFileExists to (objFileManager's fileExistsAtPath:objFilePath isDirectory:false)
log boolFileExists
-->true or false
if boolFolderExists is true then
log "○:DCはインストール済み"
else
log "×:DCは未インストール"
end if
| 固定リンク
「NSFileManager」カテゴリの記事
- [com.apple.shortcuts.mac-helper] macOS15.3.1での変更点(NSFileManager temporaryDirectoryの戻り値が変わる場合がある)(2025.02.14)
- ファイルのある親フォルダ名をファイル名にする(2024.09.13)
- [contentsOfDirectoryAtURL]コンテンツURLの収集 第一階層のみ(2024.09.02)
- [Skitch]キャッシュをゴミ箱に入れる(2023.11.11)
- [NSFileManager]ファイルのコピー (Acrobatのスタンプデータのバックアップを作成する)(2023.10.20)