Downloading photos and movies from card

First are there good sources for information on what I guess is Image Capture scripting. When I look for dictionaries I see an “Image Capture Scripting.app” and when I open it nothing happens.

What I want to do is basically get in the middle of what Aperture does automatically. I want to send any movies to say the Movies/Movies Download folder or I might just put them in iPhoto. It would be nice if the photos could be linked to Aperture, but an intermediate stop of downloading them to a temporary folder might be better as I could rename them.

Question: How can I get a script or if need be ASS application to know a card has been inserted and then either download the files to a folder or identify the contents to deal with them?

Thanks

The most direct route is to use launchd. See Craig Smith’s tutorial.

Thanks, I’ll look at that. Well I did already, but will take a bit of reading to absorb it.

It also occurred to me that I could set ImageCapture default for card input to be whatever AS I create. Haven’t looked into that, but since AS can create applications if I understand it correctly. At least now I have options.

It looks scarier than it really is. Basically, once you have your AppleScript written to download and sort the images from the card, and all the bugs are cleared, you just have to set up the launchd system to always be watching for it. I will say that it works MUCH better on Intel Macs than on the PowerPC machines. In my opinion (I wrote the article) the hard part is getting the script to work correctly without any user interaction. If you need user interaction, that is not a problem, but your AppleScript must be saved as an application and the launchd plist is a little different.

We are all prepared to help you in any way we can, so feel free to ask as many questions as you like to get the initial script working for you.

Craig

You’re right, it’s not that bad.

I’ve also just ordered Rosenthal, in part based on your review. Perry and Neuburg don’t quite cut it for me.

Greg

You won’t regret buying Hanaan Rosenthal’s book, although I like Neuburg’s too.

Thanks guys, I got it working, BUT

Next step was to test with a couple of cards, which expanded to three and I realized they all had different names. I have a couple of other cards and in time will have others.

There will always be a DCIM folder at the first level, but I don’t want to hard code all the card names. Otherwise it won’t be robust enough.

Is there a way to determine the name of the newly connected card? This should be able to deal with mounting and unmounting of hard drives too.

Or should I look more into the idea of using Image Events, assuming that what detects the card insert for Image Capture?

Thanks

If you have set up launchd to watch the /Volumes path, you can use this as your sentinel script:


set photo_cards to {"card01", "card02", "card03"}
repeat with a_disk in (list disks)
	if (a_disk as string) is in photo_cards then run script "EmptyCard.scpt"
end repeat

The list photo_cards can hold the names of all your cards. Since the script is triggered every time a new volume is mounted or unmounted, it will run through the list of card names, and run your emptying script ONLY when one of the listed cards is present. In this form, ANY time you mount or unmount a volume and one of your photo cards is hooked up, the script will execute, so you either need to remember to disconnect the card as soon as it is done, or not pop in any CDs or plug in any hard drives until it is over. I cannot figure out how to make a property value (like I did with the single flash card for the article), since it was only watching for a single file, not a group of cards. This is a good puzzle (for me, at least), and I will let you know if I come up with anything before someone else does.

That would be neater than what I would have done, but it will not be robust enough. I don’t want to hard code the card names.

The workflow:

  1. Remove card
  2. Download (we’ll come back to this one)
  3. Replace card
  4. Confirm that some photos from this card were downloaded-one can’t go photo by photo comparision)
  5. Erase card

On the road this involves at least two cameras, batteries to charge, sometimes more than one card, etc.
This process will be used on two computers.

The problem I’m trying to solve is that if one downloads with Aperture, movies (.mov and .avi currently for me) do not get downloaded. Downloading with Aperture has many advantages, so I don’t want to have to manually download the card then reload the files into (yes into, Aperture has it’s own file structure); pick out the movies and put them in another folder or load into iPhoto, and then delete the downloaded files).

My plan was to look on the card for movies, download them, then turn the process over to Aperture.

I’m afraid if I hard code the card names, I’ll get a new card with a new name or some erasing procedure in the camera will rename it, and I’ll inadvertently delete the movies without downloading them. Downloading cards can take tens of minutes, and there are already al lot of steps to go through, so anything that can be automatied will reduce the chance of mistakes.

If I’m on the road and it doesn’t work, I don’t want to be looking at AppleScripts.