AppleScript名:asoc_レコード内の計算(合計)v2 |
— Created 2014-11-19 by Takaaki Naganoya — 2014 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aCompanyRec to {employees:{{age:20, nameStr:"A"}, {age:23, nameStr:"B"}, {age:19, nameStr:"C"}}} set aDic to current application’s NSDictionary’s dictionaryWithDictionary:aCompanyRec set aveAge to (aDic’s valueForKeyPath:"employees.@sum.age") set aveAgeNum to aveAge as real –> 62.0 |
More from my site
(Visited 17 times, 1 visits today)