Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement