[NSProcessInfo] environment ENV情報を取得する
#!/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.6"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application
set ocidProcessInfo to refMe's NSProcessInfo's processInfo()
set ocidEnvDict to ocidProcessInfo's environment()
set ocidKeyArray to ocidEnvDict's allKeys()
repeat with itemKeyArray in ocidKeyArray
set ocidValue to (ocidEnvDict's valueForKey:itemKeyArray)
log "" & (itemKeyArray as text) & ":" & (ocidValue as text) & ""
end repeat
set strHOME to (ocidEnvDict's valueForKey:"HOME") as text
set strUSER to (ocidEnvDict's valueForKey:"USER") as text
set strLOGNAME to (ocidEnvDict's valueForKey:"LOGNAME") as text
set strTMPDIR to (ocidEnvDict's valueForKey:"TMPDIR") as text
| 固定リンク
「NSTask」カテゴリの記事
- [NSTask] NSTaskでpython3スクリプトを実行する(pyスクリプト実行)(2024.11.21)
- [NSTask] NSTaskでシェルを実行する(コマンド実行)(2024.11.21)
- [NSTask] NSTaskでシェルを実行する(スクリプト実行)(2024.11.21)
- [NSTask] NSTaskでシェルを実行する(コマンド実行)(2024.11.21)
- [NSProcessInfo] environment ENV情報を取得する(2023.06.14)