Using applescript to delete a photo given its path

I'd like to build a little Applescript that take an image path and permanently:
- delete that photo from the library
- delete that photo from the computer
- deletes the associated thumbnail (if any)
Does someone have an example script that I could use for that?

Louis:
You can either "flag" the photos or give them a unique keyword so that you can search for either, find the group and delete them, emptying the iPhoto trash once they are moved to it.
TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

Similar Messages

  • If I reset/restore my old iPhone 4 for my sister to use, will it delete the photos in the photo stream on the phone from iPhoto on my macbook?

    I want to delete everything off the phone but don't want the photo stream to update on the mac and delete the photos saved on it from the iPhone 4.
    Thanks

    See this document:
    What to do before selling or giving away your iPhone, iPad, or iPod touch  http://support.apple.com/kb/ht5661
    If you proceed like described above, your Photo Stream should not be erased in iCloud, but it would be safer to download all Photo Stream photos to events on your Mac.

  • Why can't I delete synced photos from my iPhone?

    Early iPhones did not have especially good cameras, so this was not an issue. However, starting with the iPhone 4s, it became clear that iPhones would begin to replace standard point-and-shoot cameras. Space would soon become a problem. You could be on a trip and begin to run out of space and find that any photos you had synced using iTunes (before your trip) could not be deleted. Even if you had an iPad with more storage, you could not delete those older synced photos. Apparently, you were supposed to have brought your Mac or PC on the trip, just so that you could use iTunes To delete synced photos.
    I don't understand Apple's rationale for this limitation.
    As of this writing, Apple does not provide a tablet that runs iTunes. So it would seem that the only solution is to buy a PC tablet such as Microsoft surface tablet. Only then would you have a full fully portable tablet that would allow you to run the iTunes program to delete old synced photos and make more room on your iPhone.
    Of course you can use airdrop to transfer photos from the iPhone camera roll to an iPad and then delete them from your iPhone, but why would you want to get rid of the newer photos on your iPhone rather than the old ones that had been synced before your trip?
    SInce Apple does not offer a tablet that runs OS X (and therefore is iTunes capable), this policy would seem to be in advertisement for Microsoft.
    Am I missing something?

    When the new iCloud Photo Library and its accompanying Photo app for Mac is available, this problem will go away. In the mean time, you have another option. Instead of syncing albums or photos from your photo library onto your device, why not create a shared Photo Stream with the older photos you want to have with you? Those can be deleted as you wish.
    Or, as Ralph suggested, if you are planning a trip, remove the excess photos before you leave so you do not run out of room.
    Cheers,
    GB

  • I have lost pictures in my albums. Only some.  I deleted same photos from last 18 months because they were duplicates.  Did this make the pictures disappear from yhe albums?

    I have lost the pictures in most of my albums.  After I creatd the albums, I went back to the same pictures in the last 18 months and erased them.  Did this cause the album pictures to also be erased?  My Itunes was acting like my Ipad was attached, but it  was not.  Help

    Was that in iPhoto on your Mac or on your iPad?
    , I went back to the same pictures in the last 18 months and erased them.
    Then, sorry to say, you will have deleted the photos  from your iPhoto library.
    Have you checked iPhoto's Trash and the Trash on your Desktop, if the photos are still there? Then put them back from iPhoto's Trash or move them back from the trash basket on your Desktop.
    Did this cause the album pictures to also be erased?
    Albums do not store photos or duplicate photos - they are a way to group photos that are stored in events,  just an index, showing you a subset of the photos in the library. A photo can be used in many albums, without needing more storage. When you delete a photo from its event, it will be removed from all albums, and all other views of the iPhoto library. Never delete a phot from its event, unless you want to remove it completely from your iPhoto library. A photo is only a duplicate, unless you have imported the same file twice and you see the copy in an event.
    iPhoto has several views, that may show you the same photos in different groupings, for easy access, but do not contain duplicates.
    If you cannot retrieve your photos from the Trashs, restore your iPhoto Library from the last backup, that contains all photos.  If there is no recent backup, you may want to try recovery software - then stop using your mac and don't do anything that writes to your harddisk, until you recovered, what is still on your disk.
    For example,
    Disk Drill: http://www.cleverfiles.com/
    usually makes a very good job of finding any jpegs, that still can be found on the harddrive.
    My Itunes was acting like my Ipad was attached, but it  was not.
    I don't understand, why you mention the iPad? Have you synced your photos to your iPad and are there still copies of them in your albums on the iPad?
    Regards
    Léonie

  • Suppose you create an album of photos imported from your iPhone with roll, then delete those photos on the roll ... because they were also deleted on the album?

    suppose you create an album of photos imported from your iPhone with roll, then delete those photos on the roll ... because they were also deleted on the album?

    If you create an album directly on the phone, then if you delete the photo from its original album then it will also be deleted from all albums that you've copied it into; if you just remove it from the newly created album then it will just be deleted from that album, it will still be in its original album and any other albums that you've copied it into.

  • If I use a backup machine that has a folder of my iphoto library, can I delete my Iphoto library without the machine updating and deleting the photos as well?

    Hey everyone, I have a Lacie 1 TB back up machine that I use to backup every once in a while everything I have in my macbook pro.
    I don't know if there's a difference between a hard disk in which you save whatever you want or a back up machine that backs up whatever you have in your computer once you connect it, so, My question is the following:
    Having backed up my Iphoto (I checked if there's a folder in the machine with all my photos), can I now get rid of all my photos in the laptop so there's more space? If I delete my photos (in Iphoto), does the back up machine automatically update its folders and delete my saved iphoto contents as well?
    Thank you!
    I'm doing this because my laptop is running really slow lately and makes a lot of noise (like an airplane getting ready for take off) even though I've used it for a year.
    I use a Macbook pro 15''
    OS X Version 10.8.4
    processor: 2.2 GHz intel core i7
    Memory 8GB 1067 MHz DDR3
    Startup disk : macintosh HD

    Okay:
    Except an arrow turning in circle near the ''wireless'' or ''sound'' symbols on the top of the screen. If I click on it, I see ''enter time machine'', ''back up now'', ''open time machine preferences''.
    You're using Time Machine to back up to the External Disk.
    Back to your first question:
    Having backed up my Iphoto (I checked if there's a folder in the machine with all my photos), can I now get rid of all my photos in the laptop so there's more space?
    No.
    Time Machine keeps a rolling back up of your data. Eventually, anything you delete from your Mac will be deleted from iPhoto too.
    If space is an issue then get another HD. They're not expensice and you can put your iPhoto Library on it.
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD

  • When using Iphoto to import photo from existing folder, what happens if I delete the photo in Iphoto ? Will the original file in the folder be deleted too?

    When using Iphoto to import photo from existing folder to iphoto, what happens if:
    1. I delete that photo in iphoto? will the original file in the folder be deleted too ?
    2.  when importing, does the hard disk store 2 versions of the photo, hence occupying additional space in the harddisk?

    1 - no  --  iPhoto only manages fiel within the iPhoto library - it does not ever do anything with files outside the library
    2 - No idea what you are asking - by default (and strongly recommended) iPhoto copies the original to the iPhoto library and you delete the source file outside the iPhoto library - iPhoto alwasy has at least two versions of every photo and some times three - it always have the original, a thumbnail and once a photo is modified a preview - this is not optional - if it is not what you want then iPhoto is not the correct progrtam to be using for phopto management
    LN

  • TS3697 There is no camera roll download pop up after connected to iTune, to solve that I used Photo Transfer App to download the Photos, but how can I delete the photos in the camera rolls, as there are 9000 photos in the camera roll

    There is no camera roll download pop up after connected to iTune, to solve that I used Photo Transfer App to download the Photos, but how can I delete the photos in the camera rolls, as there are 9000 photos in the camera roll

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • How do I delete a photo from my desktop which keeps showing the following info. every time I try to move it to the trash?:  "DSC_0073.JPG" can't be opened right now because it's being used by another task, such as moving or copying an item or emptying the

    I dragged a copy of a photo onto my desktop from iPhoto, and it seems to be in some state of process/activity (vs. just being a copy of a photo on my desktop).  I tried to delete/move to trash the photo, and I keep getting the following message:  “DSC_0073.JPG” can’t be opened right now because it’s being used by another task, such as moving or copying an item or emptying the Trash. Try again when the current task is complete.
    How do I delete this photo from my desktop?
    Thanks!

    I ended up shutting down my system, and when I started it back up, I was able to drag the photo to the trash and delete it (I did get a message warning that my deleting the photo might negatively affect the application that was "using" it, but I deleted it anyway...it worked...and I'm hoping I didn't adversely affect another application!).
    Thanks so much for your help!

  • I currently have 1,177 photos on my iphone (4s) but it takes up 4.9 GB of space. Why is it so large? I do not use photostream - this is simply within my "Camera Roll". Other than deleting the photos, can someone tell me another solution?

    I currently have 1,177 photos on my iphone (4s) but it takes up 4.9 GB of space. Why is it so large? I do not use photostream - this is simply within my "Camera Roll". Other than deleting the photos, can someone tell me another solution?
    My friend has over 2,000 photos on her iphone and it only used 1.7 GB of space and I know I had at one point over 3,000 photos on my phone and still had space left for more.
    Any tips are greatly appreciated!
    Thanks,
    Melissa.

    When you open your camera app, does it say "HDR on" at the top?
    HDR photos are better quality but take up much more space.
    Also, go to Settings>photos and camera.  Scroll down to "keep normal photo".  Is it on?  This feature saves a normal copy and an HDR copy of every photo you take.
    I bet your friend has this feature turned off along with the HDR as well.

  • Error deleting events in iCal using applescript

    Hi,
    I made a little applescript to insert and remove a roster in iCal for me and my collegues.
    While the script to remove a roster works fine on my computer, others are getting an error:
    see Link: [http://i359.photobucket.com/albums/oo31/Bronco_Dappe/Allerlei/Afbeelding1.png]
    [the error contains some strange characters but in general it says:
    "can not get class ... of event id ... of calendar id ..."]
    My applescript to delete the roster is:
    on run {CalendarName, Start, Eind, Prefix}
    -- Start and Eind format:
    -- int(day) int(month) int(year) int(hour) int(minutes)
    -- ===============================
    on run
    set CalendarName to "MP"
    set Start to "15 10 2009 00 00"
    set Eind to "17 10 2009 23 59"
    set Prefix to "MP:"
    -- Version 3.0
    -- ========
    -- Changed format of Start & Eind to be compatible with Snow Leopard
    -- convert DateStart
    set wordsplit to (words in Start)
    set DateStart to (current date)
    set year of DateStart to (item 3 of wordsplit)
    set time of DateStart to 0 -- reset time
    set day of DateStart to 1 -- prevent february 31
    set month of DateStart to (item 2 of wordsplit)
    set day of DateStart to (item 1 of wordsplit)
    set DateStart to DateStart + ((item 4 of wordsplit) * hours + (item 5 of wordsplit) * minutes) -- set time
    -- convert DateEind
    set wordsplit to (words in Eind)
    set DateEind to (current date)
    set year of DateEind to (item 3 of wordsplit)
    set time of DateEind to 0
    set day of DateEind to 1
    set month of DateEind to (item 2 of wordsplit)
    set day of DateEind to (item 1 of wordsplit)
    set DateEind to DateEind + ((item 4 of wordsplit) * hours + (item 5 of wordsplit) * minutes)
    tell application "iCal"
    set TargetCalendar to first calendar whose title is CalendarName
    set list2bDeleted to {}
    set list2bDeletedSum to {}
    set listEvents to every event of TargetCalendar
    repeat with singleEvent in listEvents
    if summary of singleEvent starts with Prefix then
    set eventstart to start date of singleEvent
    if eventstart ≥ DateStart and eventstart ≤ DateEind then
    if summary of singleEvent starts with Prefix then
    copy uid of singleEvent to end of list2bDeleted
    copy summary of singleEvent to end of list2bDeletedSum
    end if
    end if
    end if
    end repeat
    repeat with eventUID in list2bDeleted
    delete (every event of TargetCalendar whose uid is eventUID)
    end repeat
    end tell
    return list2bDeletedSum
    end run
    In general the script works like this:
    1. it goes over events in a specified calendar
    2. all events to be removed are added to a delete-list by id
    3. all events in the delete-list are removed using this id
    it seems step 3 creates a problem.
    any suggestions here?
    ghislain
    Message was edited by: ghis74

    Once I got access again to an apple with Leopard I solved the problem.
    The applescript was saved in Snow Leopard.
    When opened in Leopard 'uid' in 'copy uid of singleEvent to end of list2bDeleted' was changed into '<<class>>' : 'copy <<class>> of singleEvent...'.
    Quite strange - but correcting and saving the script in Leopard solved the problem.
    Thanks for your help.
    Ghislain

  • I deleted all my photos and videos and then delete the deleted files but the photo app is still taking up 12 GB of space and I have no room for new stuff.  How can I clear the memory space used by my deleted videos and photos?

    I deleted all my photos and videos and then delete the deleted files but the photo app is still taking up 12 GB of space and I have no room for new stuff.  How can I clear the memory space used by my deleted videos and photos?  I don't know why the photos are still taking up space and if I will have to reset my phone to get rid of the problem.

    Hey there TowneJ,
    Welcome to Apple Support Communities.
    The article linked below provides troubleshooting tips that’ll likely resolve the issue that you’ve described, where deleted files appear to be taking up space on your iPhone 5.
    If you get a "Not enough free space" alert on your iPhone, iPad, or iPod touch - Apple Support
    So long,
    -Jason

  • How do I reorganize my photos on iPad 2?  I need to move (not copy) photos from one album to another.  When I use the copy function to another album, and then try to delete an image from the original album, the system wants to delete the photos from all a

    How do I reorganize my photos on iPad 2?  I need to move (not copy) photos from one album to another.  When I use the copy function to another album, and then try to delete an image from the original album, the system wants to delete the photos from all albums.  Please help.

    You can't do it directly on the iPad - the new album functionality basically only allows you to copy photos into those new albums, you can't move them. The way that I think of it as working is that you are just creating pointers to the photos in those new albums, so if you then delete the original photo on the iPad you therefore automatically delete all the pointers to it.
    If you want to re-organise your albums then you will need to do it on your computer and then sync those albums over to the iPad

  • HT201250 If time machine puts all of my photos onto my external hard drive using time machine, can I then delete the photos from my computer put view them again from the external hard drive? Basically, can I free up space on my mac but not lose years of p

    If time machine puts all of my photos onto my external hard drive using time machine, can I then delete the photos from my computer but view them again from the external hard drive? Basically, can I free up space on my mac but not lose years of photos?

    To add to Niel's comment bear in mind that if you have a backup copy on an external HD and later delete the orignals on your Mac HD you will then only have one copy - so no backup.
    If the pictures are precious you should have at least two copies, and ideally another copy kept off site,

  • Hi there,I have just purchased an apple mac air and i want to delete       some photos i have put on in iPhoto. Can anybody tell me how to do it?i am used to windows right click and press delete, there must be an easy way to do this. Cheers Pete.

    Hi there, I have just purchased an apple mac air and i want to delete some photos i have  put on i photo.I am used to windows where you right click and press delete.Does anybody know how to do it? Cheers Pete.

    lamptramp wrote:
    Hi there, I have just purchased an apple mac air and i want to delete some photos i have  put on i photo
    Open iPhoto and from the Menu Bar... Click on Help... Type in Delete and choose from the Selected Topics.
    lamptramp wrote:
    ... am used to windows ...
    See >  http://www.apple.com/support/macbasics/

Maybe you are looking for