-
Notifications
You must be signed in to change notification settings - Fork 2
/
osx_photos_export.AppleScript
executable file
·30 lines (26 loc) · 981 Bytes
/
osx_photos_export.AppleScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# This script is from:
# "Export Albums to Folders - Jacques Rioux's Script"
# https://discussions.apple.com/docs/DOC-9561
# I've modified it so that I get a popup asking me for
# a destination folder.
#
set destFolder to (choose folder)
set dest to POSIX path of destFolder as POSIX file as text -- the destination folder (use a valid path)
tell application "Photos"
with timeout of 600 seconds
activate
set l to name of albums
set albNames to choose from list l with prompt "Select some albums" with multiple selections allowed
if albNames is not false then -- not cancelled
repeat with tName in albNames
set tFolder to dest & tName
my makeFolder(tFolder) -- create a folder named (the name of this album) in dest
export (get media items of album tName) to (tFolder as alias) without using originals
end repeat
end if
end timeout
end tell
on makeFolder(tPath)
do shell script "mkdir -p " & quoted form of POSIX path of tPath
end makeFolder