The Photos Extras Suite contain useful commands not found in the the other suites.
show location in Mapsv : (Available in Photos Utilities script library 1.1) Show location pins in the Maps application for each of the specified media items. By default, the title of the media will be used as the pin description. If the media item has no title, the filename will be used instead.
show location in Maps
forobject reference(s) : References to the media item(s) whose locations are to be displayed
[ map typeinteger ] : A number indicating the type of map to display. 0 = standard, 1 = satelite, 2 = hybrid (satelite and traffic)
→ list of media items : A list of the media items provided as input
Script Examples
The following scripts demonstrate the use of the commands in the Photos Export Suite.
Show Location in Maps
01
usescript "Photos Utilities"
02
03
tellapplication "Photos"
04
settheseMediaItemsto get the selection
05
show location in MapsfortheseMediaItemsmap type 1
06
end tell
And here is a script you can use to add a screen capture image of the Maps window to a new slide in Keynote:
Add Image of Maps Window to Keynote
01
tellapplication "Maps"
02
activate
03
if the (countofwindows) is 0 then errornumber -128
setwindowCaptureFilePath to pathToPicturesFolder & "map-window.png"
09
-- set the capture to begin after 3 seconds and to capture just the window (no shadow)
10
setcommandStringto "screencapture" & space & "-T" & space & 3 & space & "-ao" & space & "-l" & space & thisID & space & (quoted formofwindowCaptureFilePath)
11
do shell scriptcommandString
12
end tell
13
tellapplication "Keynote"
14
activate
15
if not (existsdocument 1) then
16
setthisDocumenttomakenewdocument
17
else if the (countofdocuments) is not 1 then
18
setdocumentNamesto thenameof everydocument
19
setchosenDocumentto (choose from listdocumentNameswith prompt "Pick the document to add the image to:")
20
ifchosenDocumentisfalsethen errornumber -128
21
setchosenDocumenttochosenDocumentasstring
22
setthisDocumentto the firstdocumentwhosenameischosenDocument
For those interested in creating and writing scripts and script libraries, the Photos Utilities Script Library is written in AppleScriptObj-C, a dynamic fusion of the AppleScript and Objective-C programming languages. The source code of the library can be viewed in a script editing application.
Comprehensive 3rd-party documentation and tools for writing and deploying AppleScriptObj-C applications, scripts, and script libraries are available from Myriad Communications.
DISCLAIMER
THIS WEBSITE IS NOT HOSTED BY APPLE INC.
Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. PHOTOSAUTOMATION.COM assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. PHOTOSAUTOMATION.COM provides this only as a convenience to our users. PHOTOSAUTOMATION.COM has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and PHOTOSAUTOMATION.COM assumes no responsibility in this regard. Please understand that a third-party site is independent from PHOTOSAUTOMATION.COM and that PHOTOSAUTOMATION.COM has no control over the content on that website. Please contact the vendor for additional information.