AppleScript名:Map.appで住所検索表示 v4 |
use AppleScript version "2.4" use scripting additions use framework "Foundation" set aBaseURL to "http://maps.apple.com/" set aParam to "東京都港区六本木6丁目10番1号" –Apple Japanの住所 set aRec to {q:aParam} set cURL to retURLwithParams(aBaseURL, aRec) of me tell application "Maps" open location cURL end tell on retURLwithParams(aBaseURL as string, aRec as record) set aDic to current application’s NSMutableDictionary’s dictionaryWithDictionary:aRec set aKeyList to (aDic’s allKeys()) as list set aValList to (aDic’s allValues()) as list set aLen to length of aKeyList set bLen to length of aValList if aLen is not equal to bLen then return false set qList to {} repeat with i from 1 to aLen set aName to (contents of item i of aKeyList) as string set aVal to (contents of item i of aValList) as string set the end of qList to (current application’s NSURLQueryItem’s queryItemWithName:aName value:aVal) end repeat set aComp to current application’s NSURLComponents’s alloc()’s initWithString:aBaseURL aComp’s setQueryItems:qList set aURL to (aComp’s |URL|()’s absoluteString()) as text return aURL end retURLwithParams |
com.apple.Maps
More from my site
(Visited 54 times, 1 visits today)