Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Saved search for Photo Stream not working in Mavericks

I have a saved search for JPGs in my photo stream so I can easily access them via Finder instead of iPhoto. In Mavericks my saved search no longer sees my latest photo stream iPhone pics. Anyone else notice this? I can see them in iPhoto though. I've tried re-doing the search, etc, but it doesn't work. Any suggestions?

Posted on Nov 5, 2013 7:18 AM

Reply
42 replies

Apr 9, 2014 11:11 AM in response to 5-string

The automator action listed in this thread works fine with one caveat - since it is touching each image file each run - it causes Time Machine to think each file has been modified and needs to be backed up. So for me I was seeing HUGE Time Machine backups and when I investigated it was because Time Machine was backing up the whole sub folder each run instead of just the newest additions. You can check your own Time Machine backups to see if this is the case on your machine(s) using the free Time Tracker app (Instructions here: http://pondini.org/TM/A2.html)


I re-engineered the original Automator workflow to only add the spotlight comment to new files that appear in the sub folder and that do not already have a spotlight comments. This way - the only files being touched are actually new additions to the sub folder. The new component of the workflow is a shell script that finds only the files without comments and adds the "PhotoStream" comment to those files. You can change the text that is added to the comment in line 5 of the shell script if you desire. Just change "PhotoStream" to whatever you want your comment to be. It probably runs a bit faster as well since it is a bash shell script instead of automator actions.


Following jesstech original post - the instructions are the same but the workflow is changed:


Start Automator and create a new Folder Action. In the "Folder Action receives files and folders added to" section, choose the sub folder at ~/Library/Application Support/iLifeAssetManagement/assets/sub. In the "Actions" column on the left, choose the "Files & Folders" category and drag the following two actions to the workflow, in this order:


Get Specified Finder Items
Run Shell Script



In the settings for the first action "Get Specified Finder Items", add the very same sub folder you chose earlier. If you would like to include images from "shared" Photo Streams, add the sub-shared folder inside /iLifeAssetManagement/assets as well.


For the second action, "Run Shell script", change the "Shell" dropdown menu in the upper left to "/bin/bash" and change the "Pass Input" dropdown menu to "as arguments". Then enter the following shell script into the action space below:

files="$(find -L "$@" -type f \( -iname "*.png" -or -iname "*.jpg" -or -iname "*.gif" -or -iname "*.tif" \))"
echo "$files" | while read file; do
comment=`/usr/bin/mdls -nullMarker "" -raw -n kMDItemFinderComment "$file"`
if ["$comment" = ""]; then
xattr -w com.apple.metadata:kMDItemFinderComment "PhotoStream" "$file"
fi
done


The final workflow should l look like this:


User uploaded file

Apr 9, 2014 8:10 PM in response to roccit

The Get Folder Contents is not needed as all of those steps are included in the shell script. The first line in the shell script searches the "sub" directory looking for jpg, gif, png files. It sends that list to mdls which as far as I know is standard issue on all current Macs. mdls is able to read each files Finder comments and creates a list of all files without a Finder comment. It then sends that list to xattr which is able to write a comment to the File.


FWIW - the comment that is written to the file is not visible in the Finder "Get Info" window. It should be - but I think I long standing Finder issue causes it not to appear. If you are judging the viability of the workflow - check your "Saved Search" and see if it is updating. I installed this workflow this morning and I have taken several photos throughout the day and the Saved Search has been updating like a champ all day long. It can occasionally take a few minutes before Photostream actually updates - but it does update.


Since this workflow does rely on a few binarys which I believe are standard issue - you might want to double-check that you indeed have these binaries. Open the Terminal.app and copy and paste the line below into a new window then hit enter or return.


which xattr mdls


you should see this appear below it:


/usr/bin/xattr

/usr/bin/mdls


Let me know if for some reason you don't see those two line appear. Maybe i am wrong about the standard issue or maybe they were installed by Xcode or something that is not standard on most users machines.


Jan 19, 2015 11:57 AM in response to 5-string

Hi all,


sorry for bringing this old thread up, but since updating to Yosemite the search folder isn't working anymore. Somehow it seems that folder actions are not working probably anymore. Because when I'm executing the automator script out of the Automator App, all missing pictures are showing up immediately. But it is not working automatically.


Any suggestions?


Thank you!

Saved search for Photo Stream not working in Mavericks

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.