You are here

7 posts / 0 new
Last post
Script to watch a smart folder #1
Clint Thayer's picture
by Clint Thayer
January 12, 2012 - 10:56am

Is there a way to script up something that would watch a smart folder and then do an action on any images that happen to meet the criteria to be in said folder?

Morten Scheel's picture
by Morten Scheel
January 13, 2012 - 9:47pm

Using folder actions you can attach an AppleScript or an Automator workflow to a folder and have it run automatically each time something is added to that folder.
Since the images haven’t been imported to Aperture at that point, you can only use criteria that Finder knows about.
I have a lot on my plate right now so I won’t be able to write it for you, but I’d by happy to assist if you decide to do it yourself.
Morten

PhotoJoseph's picture
by PhotoJoseph
January 14, 2012 - 4:25am

Morten,

I think Clint meant a script that would attach to an Aperture Smart Album; is that right Clint?

I don’t know that it’s possible…

@PhotoJoseph
— Have you signed up for the mailing list?

Michael Martin's picture
by Michael Martin
June 18, 2012 - 7:47am

If you create a smart folder in Aperture, you can then create an Automator workflow to carry out various actions on any images in that Smart Folder, from exporting at defined sizes, adding presets and other adjustments etc. Of course you would need to run this every so often though you could create a script to run it for you at set time intervals in the background.

Hope that helps.

PhotoJoseph's picture
by PhotoJoseph
June 18, 2012 - 11:48am

Michael,

Can the script “tickle” the Smart Album to force it to refresh? Because the Smart Albums don’t refresh unit you click on them.

@PhotoJoseph
— Have you signed up for the mailing list?

Michael Martin's picture
by Michael Martin
June 20, 2012 - 4:57am

Hi Joseph

I am sure it is possible, but my knowledge is not that great. What you could do is create a Folder Action that triggers another. For example, I have just set up a method for wireless shooting. Images arrive in a desktop folder called D3 (choose whatever name is required) from the WT4 and Nikon D3.

The first attached folder action imports those images by reference into a designated Project. Within the Project I have three Smart Albums, one of which is for Flagged images that I want to appear in a web based slide show on my personal webpage for which there is a folder called Slideshow.

The second folder action attached to the D3 desktop folder is triggered every time a new image lands in that folder. The action first goes to the Slideshow folder and deletes all images in it that were created Today, then it goes to the Flagged Smart Album and exports all the images within it to the Slideshow folder, thus refreshing the slide show with any images I want displayed on the remote screen. They are also exported with watermarking and branding as required, just set up as an Export Preset.

The issue I foresee is that with somebody shooting hundreds of images going back to the D3 trigger folder, then the slideshow may never get to run completely as it will be refreshing avery few seconds, so I removed the 2nd Folder Action from the D3 folder and created an application that resides in my dock. One click of the icon triggers the refresh of the slideshow. I had to include the delete part as each time the images were exported, it created multiple copies of those that were already there, which messed up the running of the slideshow.

All this was done using Automator. I guess it would be possible to write a script that runs the action every 15 minutes or other set interval and I may try to get that done at some point.

I am sure somebody with good knowledge of script could write something to do this in a more efficient manner, but for now this works for me.

Regards,
Michael

Morten Scheel's picture
by Morten Scheel
June 20, 2012 - 3:42pm

Thanks for your input Michael. That sounds like an awesome workflow. I tried doing something similar a while back, but I failed to make it work, so… kudos :)

Yes it’s possible to run a script periodically with a specified delay between executions (by saving the script as a “stay open application” and adding an “on idle” handler with the code to execute). It’s also possible to make it notice if new images have arrived since last time it ran, and perform actions on those images.

@Joseph: I haven’t tried it yet, but I assume it would be possible for the script to select the smart album automatically after the script has found new images and applied changes to them. I believe this should force it to refresh since it’s basically the same as clicking on the album.

You may login with either your assigned username or your e-mail address.
Passwords are case-sensitive - Forgot your password?