Add to iPhoto removes file name

Apple Mail - It's great that we now have the return of the "Add to iPhoto" link for image attachments However, when using this function Mail renames the file as IMAGE, IMAGE-1, IMAGE-2 etc etc in the metadata.  This creates an issue where iPhoto is then unable to detect if any of the imports are already in the library, ie duplicates.
A work around is to "Save" the images to a folder then using iPhoto "Add to Library" but this should not be necessary of course.
I found this issue on both Macs in my home so presume it could be a wide spread issue?   Anyone have any experience of it.

01. As per casdvm, download 'ExifTool-7.20.dmg' (872 KB in size), and install 'exiftool''.
02. Try the provided starter code, editing it according to your needs ...
--- Code starts here ---
tell application "iPhoto"
set tSelection to selection -- Obtain list of selected photos.
repeat with i in tSelection
try -- Capture any unexpected AppleScript error(s).
set imagePath to (image path of i) -- Obtain full path of file.
set imagePath to quoted form of imagePath -- Encase files' full path in single quote marks.
set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"}
set imageName to last text item of imagePath as string -- Extract file name from files' full path.
set AppleScript's text item delimiters to oAStid
set imageName to get (characters 2 through ((count imageName) - 5) of imageName) as string -- Extract date and time values from file name.
set tYear to (get (characters 5 through 6 of imageName) as string) -- Extract year from file name.
if (tYear as number) > ((do shell script "date +%y") as number) then
set tYear to ("19" & tYear) as string -- Append '19' before 'tYear'.
else
set tYear to ("20" & tYear) as string -- Append '20' before 'tYear'.
end if
set createDate to tYear & "." & (get (characters 3 through 4 of imageName) as string) & "." & (get (characters 1 through 2 of imageName) as string) & " " & (get (characters 8 through 9 of imageName) as string) & "." & (get (characters 11 through 12 of imageName) as string) & ".00"
do shell script ("exiftool -DateTimeOriginal='" & createDate & "' -CreateDate='" & createDate & "' -overwriteoriginal_inplace " & imagePath) -- View 'exiftool -h' in 'Terminal'.
end try
end repeat
end tell
--- Code ends here ---

Similar Messages

  • Importing in to iPhoto using file name date/time

    Hi
    +*I posted this originally in to iPhoto section but they suggest I submit here to see if anyone knows if there's an applescript. Thanks!*+
    I'm not too sure on how to exactly explain my problem but here goes...
    I have a mobile phone that does not save date/time taken data to the picture file when it takes photos. All of my previous phones/cameras have so this has never been a problem before. I Bluetooth photos and then add them to iPhoto '08.
    Problem is when they add they use the date/time added to create the event rather than the date/time taken. The picture filename displays date/time taken and I was wondering if there was a way to use the filename to have iPhoto adjust the metadata tag to the actual date/time taken? This would save me having to adjust time/date for each set of photos. The filename is for example P090308_12.00.jpg if taken on 09/03/08 at 12.00pm.
    I hope this is clear enough and that someone has some advice. Thanks for your help

    01. As per casdvm, download 'ExifTool-7.20.dmg' (872 KB in size), and install 'exiftool''.
    02. Try the provided starter code, editing it according to your needs ...
    --- Code starts here ---
    tell application "iPhoto"
    set tSelection to selection -- Obtain list of selected photos.
    repeat with i in tSelection
    try -- Capture any unexpected AppleScript error(s).
    set imagePath to (image path of i) -- Obtain full path of file.
    set imagePath to quoted form of imagePath -- Encase files' full path in single quote marks.
    set {oAStid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "/"}
    set imageName to last text item of imagePath as string -- Extract file name from files' full path.
    set AppleScript's text item delimiters to oAStid
    set imageName to get (characters 2 through ((count imageName) - 5) of imageName) as string -- Extract date and time values from file name.
    set tYear to (get (characters 5 through 6 of imageName) as string) -- Extract year from file name.
    if (tYear as number) > ((do shell script "date +%y") as number) then
    set tYear to ("19" & tYear) as string -- Append '19' before 'tYear'.
    else
    set tYear to ("20" & tYear) as string -- Append '20' before 'tYear'.
    end if
    set createDate to tYear & "." & (get (characters 3 through 4 of imageName) as string) & "." & (get (characters 1 through 2 of imageName) as string) & " " & (get (characters 8 through 9 of imageName) as string) & "." & (get (characters 11 through 12 of imageName) as string) & ".00"
    do shell script ("exiftool -DateTimeOriginal='" & createDate & "' -CreateDate='" & createDate & "' -overwriteoriginal_inplace " & imagePath) -- View 'exiftool -h' in 'Terminal'.
    end try
    end repeat
    end tell
    --- Code ends here ---

  • How to add increment number to file name properly

    Hi, all:
    I have a simple question. As shown in the attached code, I need to add an increment number to file name and save the file. The problem is, if you run the code and put something like ".dat" in the extension name, you will see a blank space between the number and the dot in the file name. What should I do to eliminate the blank space? I can't specify the format of the file name since the file name would vary from case to case.
    Thanks a lot for any suggestion and correction in advance.
    Attachments:
    temp.vi ‏11 KB

    Hi,
    Please take a look to the attached VI. I hope that I understood what you really want.
    I've replaced the Vi: Format into string with Number to Decimal String plus a Concatenate String. 
    Now, this is working for me, I don't get a space anymore.  If something is wrong, please let me know.
    Regards,
    Paul
    Attachments:
    temp_back.vi ‏11 KB

  • Why don't my iphoto event names match up to my iphoto master file names?

    Yosemite 10.10
    iPhoto 9.6
    MacBook Pro 2009
    I recently downloaded Yosemite, which has slowed my laptop down significantly. This has prompted me to transfer all large files - photos, movies and music off my laptop and onto an external hard drive (in addition to my time machine backup hard drive).
    I was instructed (at the Apple Store) to open Finder then Pictures > iPhoto Library. Then to right click on the iPhoto Library folder and select 'show package contents', this reveals a large list of folders but I understand that the Masters folder is the one to care about with respect to back ups. When I open up Masters I can see 8 folders labelled 2007 - 2014. In each of these folders are other folders housing all the jpeg files.
    THE PROBLEM:
    For some reason in the 2007-2009 folders the Master file names match up to the Event names in iPhoto. This is great and makes sense! However, after 2009 everything gets really messed up in the Masters folder - despite my iPhoto Library being meticulously organised into Events that are all labelled. For example, when I open up the 2014 folder the path looks like this 2014 > 10 > 06 > 20141006-214510 > which then houses the jpeg images. It looks to me like these folders represent upload events as opposed to the Events that I organised them into in the front end of iPhoto. WHY!?!
    THE QUESTIONS:
    Why is this happening? And can I fix it so that it doesn't happen when I next import photos into iPhoto?
    Should I just stop using iPhoto?
    What happens if I change the names of the Master folders in the back end of iPhoto to reflect the Event names in the front end? Would it be better to just organise them on my hard drive?
    Thank you

    1. It's not a problem as you never ever access your photos in this way.
    2. If you want to back up your original photos you do this via the Export function: File -> Export
    This User Tip
    https://discussions.apple.com/docs/DOC-4921
    has details of the options in the Export dialogue.
    3. None of this saves space on your HD. To do that you need to move your Library from the HD to the external:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    a. Quit iPhoto
    b. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    c. 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.
    d. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    4. That particular Apple Genius isn't.
    As to the specific questions:
    Why is this happening? And can I fix it so that it doesn't happen when I next import photos into iPhoto?
    It's happening as that is how iPhoto works and there is nothing ti fix. Exporting makes the issue redundant.
    Should I just stop using iPhoto?
    Why?
    What happens if I change the names of the Master folders in the back end of iPhoto to reflect the Event names in the front end?
    You'll corrupt the Library. And it's unnecessary.
    Would it be better to just organise them on my hard drive?
    No.

  • Help with importing photos - IPhoto assigning file names that already exist

    When I import photos from my canon powershot camera, IPhoto has begun assigning file names that are the same as filenames that already exist on photos imported previously. It appears it is deleting those older files (when I go look in my photo library, the older one with the same name is now gone).
    I don't know how to name photos as they are imported as it seems to be done automatically and I'm afraid to import more photos and loose my old pics. Can't find anything on the internet when I search on this question - can anyone help?

    Thanks so much for your quick reply, TD.
    What happens when I plug in my camera is that Iphoto opens, asks me if I want to import photos (and if I want to delete originals), and I click okay or whatever and they are imported. I name the roll/folder, and I photo puts them in the library in that folder in that year.
    It makes sense that the camera is numbering them. I think that the ones it is using the same numbers for (ie - IMG0080.jpg) are the numbers on older photos that were assigned by a different camera that we used to have.
    So I guess the canon isn't searching on all photo names that have been used, just the ones that it has used in the past.
    Unfortunately, when the new photo is named with the same name as an old one, that old one is literally deleted - at least as far as I can tell - and when I go look for it in my photo library, it is no longer there.
    I might try to see if there are any help forums for the canon powershot and see what I might learn there.
    THanks so much for your help!

  • Add Timestamp to Remote File Name in Output Tab

    Hi,
    Is it possible to add a timestamp to the Remote File Name in the Destination part of the Output tab?
    E.g. If I have an FTP as the desgination, can I have a file name as dailyReport20130227.pdf, where the date part is generated dynamically on every run?
    Thanks and Regards
    JB

    For everyone's reference, this is possible using the below delimiters.
    http://docs.oracle.com/cd/E15586_01/bi.1111/e18861/T539768T541118.htm
    Expression     Description
    %y     Displays the year in four digits: Example: 2011
    %m     Displays the month in two digits: 01-12 (where 01 = January)
    %d     Displays the date in two digits: 01-31
    %H     Displays the hour in two digits based on 24-hour day: 00-24
    %M     Displays the minute in two digits: 00 - 59
    %S     Displays the number of seconds in two digits: 00 - 59
    %l     Displays milliseconds in three digits: 000 - 999
    In this case, we just need to set up the file name as "+dailyReport%y%m%d.pdf+"

  • Is there a way or a plugin to add "capture time" as file name

    I just photographed a surf contest out in California - I would like to add the capture time as the file name to make it easier to identify the surfers.  Any easy ways to do this for 600 images?

    Sure, just rename the photos.
    In the library module select all photos you want renamed, go to Library > Rename Photos... (or just press F2)
    In the dialog box that appears select Edit... (the bottom option)
    and in the edit box of the next dialog paste this:
    {Date(YYYYMMDD)»}{Hour»}{Minute»}{Second»}
    If you have more than one photo in a given second, LR will append -n (where n is 1, 2, 3...) to the filename.

  • Remove file name prefix when exporting to PDF

    Hello,
    I found a script here which exports the active document as a PDF to the desktop.
    I would like for it to change the file name such that the first two characters are removed.
    Example:
    The existing file name is: X_pagelayout.indd
    I would like this script to create a PDF named: pagelayout.pdf
    Thoughts?
    Your help is very much appreciated.
    var myFolder = "~\Desktop";
    var myDoc = app.activeDocument; 
    var myDocname = myDoc.name.split(".indd");
    myDoc.exportFile(ExportFormat.PDF_TYPE, File(new File(myFolder+"\\" + myDocname.join(".pdf"))));

    Hi tlumbis,
    I didn't get any issue, any way try the below new one.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
    var myFolder = "~\Desktop"; 
    var myDoc = app.activeDocument;  
    var myDocname = myDoc.name.split("_")[1]; 
    var myNewName = myDocname.replace(/.indd/gi, ".pdf");
    myDoc.exportFile(ExportFormat.PDF_TYPE, File(new File(myFolder+"\\" + myNewName))); 
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    thx,
    csm_phil

  • Add counter in  Receiver File name

    Hello  Everyone,
    I have a Idoc to file scenaraio . The file comes regularly and whenevr the file comes, it should get suffix with datestamp and then the counter.
    The  name is should be Partner_YYYYMMDDHHMMSSL.xml.
    Where L is counter and should be increased everytime.
    Regards,
    Ravi

    try below logic:
    partnerconstant(_) concat -> time stamp udf + concatcounter concat+constant(.xml) +concat -> dynamic config udf -> target node.
    click on counter standard function and enter Initial value 1 and incremental 1 .
    time stamp udf:
    String AddTimestamp(String var1, Container container) throws StreamTransformationException{
    String DATE_FORMAT_NOW = "yyyyMMddHHmmss";
       Calendar cal = Calendar.getInstance();
        SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
        return sdf.format(cal.getTime());
    note :add import instructions(pkg) java.text.SimpleDateFormat
    dynamic conf:
    String DynamicConfig(String a, Container container) throws StreamTransformationException{
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(key,a);
    return "";
    in id:
    you have to enable ASMA and File Name properties in Receiver File Adapter.
    Edited by: bhavanisankar.solasu on Mar 7, 2012 4:13 PM

  • Audition adds _01 to the file names of my audio files

    .I record an input and give it a file name like My test audio. What I end up with is  My test audio_01.wav. Strange behaviour.

    GreyMatter2 wrote:
    I do remove them but when they are put into windows media player the _01 comes back after a short pause. This seems to be embeded into the file itself.
    No it's not, and no they don't 'magically' get renamed again unless a file of the same name already exists - which it might well.
    GreyMatter2 wrote:
    Can this FANTASTIC facility be tirned OFF.
    No it can't. Audition in multitrack mode is a direct-to-file recorder. You can't just record another file of the same name in the same place, because the OS wouldn't let you without a warning. If you wanted this as an option, then every time you tried to record another track, you'd get an OS message about an overwrite that you'd have to agree to - and that would be a PITA. So instead, when you try to do this, you get an automated addition to the end of your file, which at least lets you continue to work without interruption.
    So, it's like this for a good reason, and the reason that you can't turn it off is because of the way the OS is organised, not Audition. The only alternative would be to create a new sub-folder every time you hit record on a track. How much more mess is that going to cause?

  • Stock book help needed - want to remove file names

    Well, I'm trying to put together my first book from Aperture and chose the Stock theme for a book of family photos and I can't for the life of me figure out how to remove the file names which appear at the bottom of every image on the pages. Anyone able to point me in the right direction?

    Hello Tom,
    There may be a quicker way, but if you just click on the "Edit layout" button (which is along the toolbar just to the right of the writing "stock book", it is the square with the dotted outline). Once you click on this, you can change all sorts of things, including the size of photo boxes and, if you just click on the file names, the filename text box will appear and you can then just hit delete.
    Hope this helps.
    Best regards
    Paul

  • Add comments to a file name

    Hi
    In my VI when I want to collect and save data to CSV , I use curremt date and time for the file name but I would like to also use a popup message and ask if the operator wants to add a comment to the file name ( just a string ) . Could u plz help me how can I implement it in LabVIEW
    thanks

    Jeff·Þ·Bohrer wrote:
    They used to have to since there used to be versions of LabVIEW that did not have events And, I suppose they still have to for backwards compatability.
    I call BS.  Express VIs are newer than Event Structures by at least 1 version (Events in 6.0, Express VIs in 7Express).  I think what was missing was the scripting capability to manipulate the event structure and they haven't revisited the express VIs for a while.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to add variables in the file name in Reciever CC?

    Hi all ,
    I am working on a outbound interface .
    in the reciever communication channel i have to gve the file name as
    S<plant code >.<file name>.<timestamp > > 
    example of filename:  u201CS141. SPPFE860. 20110421114559u201D (The plant code has to be the same used in the field STABEMT presents in the header).
    now in the structure it is like
    MT
       HEADER
             STABMENT
    i am using tht Avanced tab in CC but am not able to understand what to gve in reference.
    Can you please help???

    heyy i could find the solution to it....so am closing the thread..thanksss

  • Can't remove file name from portfolio-9 Pro

    I've unchecked the Name box in the Specify File Details but the file name still appears in the portfolio display.
    Help much appreciated.
    Paul

    Try this...
    In terminal type
    defaults write com.apple.finder _FXShowPosixPathInTitle -bool NO
    charlie

  • Removing File Name from Slideshow

    Using CS4 I create a slideshow to embed in a webpage as a photo gallery. How do i Disable the display of a file name under each picture? I have tried to insert captions and everything I can see to try but the file name still appears and no captions show up??

    Which Slideshow preset are you using?
    h

Maybe you are looking for