Forked from itod/extract_iphoto_originals.applescript
Created
November 21, 2016 03:56
-
-
Save johanoloflindberg/6d0d0dc3bf8d0783bfa9a4bae5a7cd08 to your computer and use it in GitHub Desktop.
Recursively extract Original photos from an iPhoto library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set _srcPath to ((get path to desktop) & "Backup:Pictures" as string) | |
set _destPath to ((get path to desktop) & "Out" as string) | |
on processDir(_parent) | |
tell application "Finder" | |
set _parentName to (get name of _parent as string) | |
set _kids to (get every item of _parent whose name is not ".") | |
if "Thumbs" is equal to _parentName then | |
return | |
else if "Originals" is equal to _parentName then | |
repeat with _pic in _kids | |
--display dialog _pic as string | |
try | |
copy _pic to folder (my _destPath as string) | |
end try | |
end repeat | |
else | |
repeat with _kid in _kids | |
--display dialog (class of _kid as string) | |
if (get class of _kid as string) is equal to "folder" then | |
my processDir(_kid) | |
end if | |
end repeat | |
end if | |
end tell | |
end processDir | |
tell application "Finder" | |
set _dir to folder _srcPath | |
my processDir(_dir) | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment