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

AppleScript - Delete successfully imported images from disk (after import)

I have many image files that I would like to import into Aperture. I can do this one folder at a time, or many folders at a time.


These are going to be imported to Aperture's database (as managed pictures) from my iMac's internal drive (the original folder containing many images).


I would like Aperture to delete all the images that are successfully imported.

I would like Aperture to leave the images (and folder) behind that are NOT successfully imported. Perhaps they are duplicates, or perhaps they are images that are not compatible with Aperture (.wmv, etc).



Could anyone design an AppleScript that tells Aperture to delete all Succesfully Imported images from their original folder?



Thanks so much!

Aperture 3, Mac OS X (10.7.3)

Posted on Apr 21, 2012 6:28 PM

Reply
15 replies

Apr 21, 2012 6:54 PM in response to BinaryDrummer

Not easily done (if possible at all). Once an image is imported into Aperture there is no connection to where it came from so no way to find it to delete it.


But even if it was possible it would not be a good idea. You really don;t want to delete your source until you have confirmed that the image has been successfully imported and no program can determine that. There are always cases of the file being imported but some glitch causing the image not to be render correctly. A program would only know the file was imported not that it wasn't viewable.

Apr 22, 2012 6:10 AM in response to BinaryDrummer

BinaryDrummer wrote:


TO EVERYONE --


Just to verify the goal of this thread - it is not discussion. Please only respond if you do have the ability to script this.



(NOT trying to be rude! I just want to save everyone's time and, if possible, accomplish this. 🙂 No discussion is needed on the topic unless it moves toward the desired functionality.)

Sorry Dude, but you are being extremely rude. This is not your private forum and many threads take many an interesting turn into areas that are very useful to other people, even if you don't want to be bothered.


So despite your S H O U T I N G !!, here's a freebie: You can come very close to accomplishing what you want by using Referenced Masters with the "move" option engaged, no Applescript required. Enjoy! (And, if you ask, Alan will be happy to give you several reasons why a Referenced Library might be better on your hardware, etc.)

--

DiploStrat 😉


Message was edited by: DiploStrat To add "Welcome to the Forum. Many of the members here are professional photographers, computer scientists, and experienced hobbyists who have been using Aperture since it first came out. All are willing to devote insane amounts of time (in a variety of languages) to help you get the best out of your system, if you will but treat them with a minimum of courtesy."

Apr 22, 2012 6:38 AM in response to DiploStrat

by using Referenced Masters with the "move" option engaged,

But again there is no confirmation that the image was imported successfully only that Aperture took the file and moved it. The state of the image in Aperture is unknown.


There have been many cases where the file appears to be imported OK but when looked at in Aperture it is found to be corrupted in some way. There was just a thread here that went on for 7 pages or so covering this exact situation.


So again I have to say that the OPs request

I would like Aperture to delete all the images that are successfully imported.

is not doable at this time.

Apr 22, 2012 10:12 AM in response to DiploStrat

Despite your misinterpretation and sensitivity training, I have no intention of being rude -- direct and focused were the objectives.


This thread exists for 1 purpose. Everything is possible, and I look forward to hearing from someone that can accomplish it. I'll commission the script for the person with enough creativity to figure it out.


Thanks.

Apr 22, 2012 10:31 AM in response to BinaryDrummer

Everything is possible, and I look forward to hearing from someone that can accomplish it.

Frankly, you are asking a lot: Please try to understand that it would be very problematic for us to post a solution that is not safe to use - you have been told so by the most experienced users here, why it is considered unsafe to do what you want to do. You may be quite wllling to take the risk, but we have to remember that any answer posted here will be sitting around for a very long time; people will come across it and read it out of context, and they may very well just try the script, thinking it to be perfectly safe to delete images after import. I certainly do not want to be responsible for that, even if I know that you would be delighted to risk this. This is not the place to give unsafe recommendations, sorry. We are bound by strict rules here.


So try to learn Apple Script - Aperture is highly scriptable and you may enjoy writing your own scripts.


Regards

Léonie

Apr 22, 2012 10:55 AM in response to Frank Caggiano

Depends on the goal:


-- If your goal is to know that Aperture took the file, then the "move" option works perfectly, as it empties your source folder. In fact, this is exactly the process I use importing scanned slides and negatives. They start out in a folder and then are moved into the Aperture Masters Folder. When the folder is empty, I know that they have all been imported.


-- If your goal is to assure that Aperture did not somehow mess up the file, then you are correct, I know of no other way to assure a "successful" import other than the Mark One Eyeball.


Just depends on what you are trying to do.


On the other hand, I have never had an import fail in any way, dating back to 2006. I did however, encounter one "unknown format" error on a JPEG, sometime in the process of converting to Referenced Masters. A database rebuild cured the problem, but I was surprised as it was an image that had never been touched or adjusted in any way.

--

DiploStrat 😉

Apr 22, 2012 12:08 PM in response to DiploStrat

Diplo - Thanks, this is helpful. I think I've found a workaround for now:
1) Aperture Import from Folder, Make a backup of imported items to Desktop\Import.

2) Then I'll visually scan through the new Project in Aperture to make sure nothing was corrupted.

3) Then I'll bring up PathFinder, and compare the files in the original (imported) directory, and also Desktop\Import (backup)


If the # of files matches in both the source and backup folders, I'll go ahead and delete both.


After this process, my images now only reside in Aperture. 2 backups of Aperture are made nightly (1 local, 1 off-site).




LeonieDF - Regardless of anyone's particular interpretation, this is what I'm looking for for a process unique to my workflow. Thanks.

Apr 22, 2012 12:29 PM in response to BinaryDrummer

2) Then I'll visually scan through the new Project in Aperture to make sure nothing was corrupted.

To be sure you actually are checking the imported master image files while you are browsing the import, and not the previews generated in the camera or attached to the raw files, press the "m" key. This will set the viewer to display the master, while you are browsing.


Corrupted imported files may go unnoticed for a very long time, sometimes many years, if you never try to edit an image, because the preview looks o.k. and the master is never actually read by Aperture.

Apr 22, 2012 1:01 PM in response to BinaryDrummer

Good resources for AppleScript?


  • The Introduction to AppleScript Language Guide
  • To script applications like Aperture, use the dictionaries of the apps. You open them from AppleScript Editor-> File -> Show Dictionary. The dictionaries show the messages the applications understand, also the classes and properties; and you will find many sample scripts there on how to use them.
  • I personally learned most from the book Matt Neuburg: AppleScript - The definitive Guide, O'Reilly 2005; this book not only gives a very good introduction into the basic concepts of messaging and script objects, but explains the design patterns to use and most of the pitfalls to be avoided.


Regards

AppleScript - Delete successfully imported images from disk (after import)

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