Q: How to import movies into Photos using Applescript
I am trying to import a number of movies (H.264, mov) into Photos.
Originally, I wanted to do it in Automator, since the movies are created with an Automator workflow.
However, it seems that the action "Import Files into Photos" does not import movies, only images.
So I thought I could do it using an Applescript in Automator.
However, I seem to fail to do that, too.
Here is a minimal example, showing what I am trying to do:
The Applescript is this:
on run {input, parameters}
tell application "Photos"
delay 2
repeat with f in input
with timeout of 60 seconds
import f skip check duplicates yes
end timeout
end repeat
end tell
return input
end run
The image file does exist.
The error message I get from Photos is "Unable to get metadata":
When I try it with the movie file, I get a different error message: "Non of these files can be imported ..."
This makes me suspect that the import command does not allow to import movie files into Photos.
Is there any other way I can automatically import (valid) movie files into Photos?
Any hints and tips will be highly appreciated.
Best regards,
Gabriel.
MacBook Pro with Retina display, OS X El Capitan (10.11.2), iPhone 6S, always latest iOS
Posted on Aug 9, 2016 6:22 PM


