アラートダイアログ上にWkWebViewを作成し、その上でAMChartsによる点滅ポイントつき世界地図を表示するAppleScriptです。
このアラートダイアログによる「箱庭UI」シリーズも、なかなか実用性のあるソリューションにつながる例が少なくて、インパクトとかウケ狙いのものが多いですが、これにはけっこうな実用性を感じました。
世界地図上にプロットする必要のあるデータというのはなかなかありませんが、必要がある場合にはこのように部品として使えるところまで飼い慣らしてあるので、有用性は高いと思われます。
–> Download displayAMChart (Script Bundle with Library and HTML)
AppleScript名:AMChartsで点滅ポイントつき世界地図をダイアログ上に表示 v2.scptd |
— – Created by: Takaaki Naganoya – Created on: 2020/06/23 — – Copyright © 2020 Piyomaru Software, All Rights Reserved — use AppleScript version "2.4" — Yosemite (10.10) or later use framework "Foundation" use scripting additions use webD : script "webDialogLib" set zoomScale to 4 –Flash Radius –Not actual location set aList to {{title:"Shane Stanley", latitude:-33.5206, longitude:151.1231, |color|:"#0000ff", |url|:"https://latenightsw.com"}, {title:"Takaaki Naganoya (me)", latitude:35.6785, longitude:139.6823, |color|:"#ff0000", |url|:"http://piyocast.com"}, {title:"Jean-Christophe Helary", latitude:34.349399, longitude:134.025012, |color|:"#0000ff", |url|:"http://mac4translators.blogspot.com"}, {title:"Yvan KOENIG", latitude:43.57803, longitude:7.05451, |color|:"#0000ff"}, {title:"Ed Stockly", latitude:34.052235, longitude:-118.243683, |color|:"#0000ff", |url|:"https://www.latimes.com"}, {title:"Mark Alldritt", latitude:45.2512, longitude:-75.42, |color|:"#0000ff", |url|:"https://latenightsw.com"}} –https://www.amcharts.com/demos/zooming-to-countries-map/ set mePath to path to me set resPath to (mePath as string) & "Contents:Resources:index.html" set myStr to read (resPath as alias) as «class utf8» set jStr to array2DToJSONArray(aList) of me set aString to current application’s NSString’s stringWithFormat_(myStr, zoomScale as string, jStr) as string set paramObj to {myMessage:"AppleScripters I know the location", mySubMessage:"This is a AMCharts test", htmlStr:aString, jsDelimiters:{"<script>", "</script>"}, viewSize:{1000, 520}} webD’s displayWebDialog(paramObj) on array2DToJSONArray(aList) set anArray to current application’s NSMutableArray’s arrayWithArray:aList set jsonData to current application’s NSJSONSerialization’s dataWithJSONObject:anArray options:(0 as integer) |error|:(missing value) set resString to current application’s NSString’s alloc()’s initWithData:jsonData encoding:(current application’s NSUTF8StringEncoding) return resString end array2DToJSONArray |
More from my site
(Visited 243 times, 1 visits today)