{"id":2923,"date":"2015-07-27T19:57:18","date_gmt":"2015-07-28T02:57:18","guid":{"rendered":"http:\/\/www.psychocats.net\/ubuntucat\/?p=2923"},"modified":"2015-07-27T19:57:18","modified_gmt":"2015-07-28T02:57:18","slug":"using-automator-to-add-dropbox-camera-uploads-to-photos-on-a-mac","status":"publish","type":"post","link":"https:\/\/www.psychocats.net\/ubuntucat\/using-automator-to-add-dropbox-camera-uploads-to-photos-on-a-mac\/","title":{"rendered":"Using Automator to add Dropbox camera uploads to Photos on a Mac"},"content":{"rendered":"<h2>Why Script Importing into Photos?<\/h2>\n<p>Recently, Apple deprecated iPhoto on the Mac in favor of a new iPhoto-like app called Photos. The nice thing about iPhoto was that you could drag a bunch of photos onto the iPhoto icon, and those photos would automatically import as a new album. I&#8217;ve found a bit of bugginess with Photos (perhaps it will be fixed in newer versions). Sometimes dragging photos into the app won&#8217;t do anything. Sometimes it will launch up a preview and then ask to import. Other times it will just import.<\/p>\n<p>I use Dropbox&#8217;s camera upload function to have the pictures from my Android phone automatically upload to Dropbox&#8217;s servers and then down to my Mac.<\/p>\n<h2>The Automator Script<\/h2>\n<p>I made an Automator .app with a <strong>Run AppleScript<\/strong> action that runs the following script (substitute in your own path and username to whatever folder you want to import):<\/p>\n<div class=\"terminal\">\nset importFolder to POSIX file &#8220;\/Users\/<em>yourusername<\/em>\/Dropbox\/Camera Uploads\/&#8221; as alias<\/p>\n<p>set extensionsList to {&#8220;jpg&#8221;, &#8220;png&#8221;, &#8220;tiff&#8221;}<br \/>\ntell application &#8220;Finder&#8221; to set theFiles to every file of importFolder whose name extension is in extensionsList<\/p>\n<p>set timeNow to time string of (current date)<br \/>\nset today to date string of (current date)<br \/>\nset albumName to today &#038; &#8221; &#8221; &#038; timeNow<br \/>\nset imageList to {}<br \/>\nrepeat with i from 1 to number of items in theFiles<br \/>\n\tset this_item to item i of theFiles as alias<br \/>\n\tset the end of imageList to this_item<br \/>\nend repeat<\/p>\n<p>tell application &#8220;Photos&#8221;<br \/>\n\tactivate<br \/>\n\tdelay 10<br \/>\n\timport imageList into (make new album named albumName) skip check duplicates no<br \/>\nend tell<\/p>\n<p>tell application &#8220;Finder&#8221;<br \/>\n\tdelete imageList<br \/>\nend tell\n<\/div>\n<\/p>\n<h2>Acknowledgements<\/h2>\n<p>The basis for this script (with my own tweaks, of course) is <a href=\"http:\/\/applehelpwriter.com\/2015\/04\/15\/how-to-easily-import-images-into-new-photos-app\/\" target=\"_blank\">how to easily import images into new Photos.app<\/a>.<\/p>\n<h2>Tweaks in This Script<\/h2>\n<p>The main differences in my version of the script are:<\/p>\n<ul>\n<li>Specification of the folder ahead of time instead of a prompt for the user to choose a folder<\/li>\n<li>No check that there are images in the folder (Photos itself will tell you there&#8217;s nothing to import if the Dropbox folder is empty).<\/li>\n<li>Album name is based only on the date and time instead of prompting for a name and then appending a date and time.<\/li>\n<li>Waiting longer after launching (&#8220;activat[ing]&#8221;) Photos before doing the import. I found (on my non-SSD hard drive) that 2 seconds would make the Automator .app crash before importing.<\/li>\n<li>Deleting (moving to the Trash, actually) the imported folders when done.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Why Script Importing into Photos? Recently, Apple deprecated iPhoto on the Mac in favor of a new iPhoto-like app called Photos. The nice thing about iPhoto was that you could drag a bunch of photos onto the iPhoto icon, and those photos would automatically import as a new album. I&#8217;ve found a bit of bugginess&hellip; <a class=\"more-link\" href=\"https:\/\/www.psychocats.net\/ubuntucat\/using-automator-to-add-dropbox-camera-uploads-to-photos-on-a-mac\/\">Continue reading <span class=\"screen-reader-text\">Using Automator to add Dropbox camera uploads to Photos on a Mac<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[903,901,904,193,902],"class_list":["post-2923","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-applescript","tag-automator","tag-dropbox","tag-mac","tag-photos","entry"],"_links":{"self":[{"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/posts\/2923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/comments?post=2923"}],"version-history":[{"count":3,"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/posts\/2923\/revisions"}],"predecessor-version":[{"id":2926,"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/posts\/2923\/revisions\/2926"}],"wp:attachment":[{"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/media?parent=2923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/categories?post=2923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.psychocats.net\/ubuntucat\/wp-json\/wp\/v2\/tags?post=2923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}