AppleScript名:ASOCでDict読み込みして、指定のMSの搭乗回数を取得する v2 |
use AppleScript version "2.4" use scripting additions use framework "Foundation" set aName to "efsf.plist" set aFolName to "戦場の絆" set aRec to retDictFromPlist(aFolName, aName) of me set msL to msList of aRec set eList to filterRecListByLabel(msL, "msName CONTAINS ’近 ザクII(F2) 獲得済’") of me set aTimes to sortieTimes of first item of eList on retDictFromPlist(aFolName, aPlistName) set myAppSupDir to ((path to application support from user domain) as string) & aFolName & ":" tell application "System Events" –Finderでなくこちらを使ってみた tell folder myAppSupDir set aExit to exists of file aPlistName end tell end tell if aExit = false then return {} else set aPath to (POSIX path of myAppSupDir) & aPlistName set thePath to current application’s NSString’s stringWithString:aPath set thePath to thePath’s stringByExpandingTildeInPath() set theDict to current application’s NSDictionary’s dictionaryWithContentsOfFile:thePath return theDict as record end if end retDictFromPlist –リストに入れたレコードを、指定の属性ラベルの値で抽出 on filterRecListByLabel(aRecList as list, aPredicate as string) –ListからNSArrayへの型変換 set aArray to current application’s NSArray’s arrayWithArray:aRecList –抽出 set aPredicate to current application’s NSPredicate’s predicateWithFormat:aPredicate set filteredArray to aArray’s filteredArrayUsingPredicate:aPredicate –NSArrayからListに型変換して返す set bList to filteredArray as list return bList end filterRecListByLabel |
More from my site
(Visited 58 times, 1 visits today)