how to easily import images into new Photos.app
So with 10.10.3 and Apple’s new Photos’s app, people have been asking how to easily import whole folder’s worth of images into it. Here’s a nice little AppleScript that’ll do it for you very easily. Just plonk the code into Script Editor and hit the run button. 🙂
Click the image below to get the code ꜜ
Here’s the unformatted code that you can cut and paste into Script Editor, or get if from my pastebin here:
--import images from a folder into Photos.app
-- by Applehelwriter 2015 -- requires Yosemite 10.10.3
set importFolder to choose folder
set extensionsList to {“jpg”, “png”, “tiff”}
tell application “Finder” to set theFiles to every file of importFolder whose name extension is in extensionsList
if (count of theFiles) < 1 then
display dialog “No images selected!” buttons “OK”
else
display dialog “Create a new album with name” default answer “Imports”
set albumName to text returned of the result
set timeNow to time string of (current date)
set today to date string of (current date)
set albumName to albumName & ” ” & timeNow & ” ” & today
set imageList to {} repeat with i from 1 to number of items in theFiles
set this_item to item i of theFiles as alias
set the end of imageList to this_item
end repeat
tell application “Photos”
activate
delay 2
import imageList into (make new album named albumName) skip check duplicates yes
end tell
end if
Posted on April 15, 2015, in AppleScript, Yosemite and tagged 10.10.3, AppleScript, Photos. Bookmark the permalink. Leave a comment.
Leave a comment
Comments 0