photos-automation-banner
•
OS X AUTOMATION
AUTOMATOR
IWORK AUTOMATION
•

Displaying a Chosen Photo

In some workflows it may be useful to be able to have the user choose the photo to use. To present a media picker dialog, from within any application, add the “Ask for Photos” action to the workflow. This action will return a reference to the file location of the chosen Photos image. To display the chosen photo in the Photos application window, add the “Display Referenced Photo” action after the “Ask for Photos” action in the workflow.

When the workflow is executed, the system media picker dialog will be presented:

media-picker

When the user has selected an image from the picker window, the corresponding photo will be displayed full-size in the Photos window:

chosen-photo

TIP: Since the result of the “Display Referenced Photo” action is a reference to the Photos item, this action can be followed by any of the Photos actions that take media items as their input, such as the “Export Media Items to Keynote” action that is used in this workflow, included with the examples installer, for creating a new image slide in Keynote:
keynote-picker-workflow

The “Ask for Photos Helper” action

There is a known issue that occurs when the “Ask for Photos” action precedes the “Display Referenced Photo” action in a workflow. If the image chosen from the media picker (presented by the “Ask for Photos” action) has been previously edited, an incompatible file reference will passed as input to the “Display Referenced Photo” action, causing an error to occur.

The workflows examples installer provided on this website will install a special Automator action titled “Ask for Photos Helper” that you will place between the “Ask for Photos” action and the “Display Referenced Photo” action in your workflows. (⬇ see below )

This action will attempt to resolve any incompatible file reference and pass the reference type expected by the “Display Referenced Photo” action. This “translation” action will resolve references for edited images, but it will not work when the Photos library contains duplicates of the photo to be referenced.

NEXT TOPIC: Get Album Contents

TOPICS

  • Overview
  • Automator Quick-Start

  • Selection & Content
  • Current Selection
  • Choosing an Image
  • Get Album Contents
  • Add to Albums
  • Importing Media Items
  • Exporting Media Items
  • Metadata
  • Slideshow Actions

  • Scripting Overview

  • Workflow Recipes
  • Dictation Commands

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.