Change creation date with Applescript?  Any one?

Is any one good with writing AppleScript?  I've looked in the Help menu and I don't understand it.
I have a folder of over 1,000 pictures that has the incorrect "Date Created."   The correct date is actually in the "Date Modified" info for each picture.  I have no idea how this came to be.
Given that there are so many files in the folder, using the "Touch -t" command in Terminal for each one individually is.. well.. daunting. 
If any one knows how to write a quick Script to copy the "Date Modified" to the "Date Created" information going through each file in a folder (automated), karma would look good on you. 
I've been going through page after page of web-search results of "change date created mac app" with no such luck.
(OS 10.8.2)
Thanks to any one that can help in any way. 

Hi,
touch -t can change the creation date, but it can only set backward, not forward.
Here is a AppleScript that uses the class NSFileManager from the Foundation framework to change the file's creation date.
-- this script set the creation date of each file to the file's modification date
-- When the dialog will appear, just select the files whose creation date is incorrect.
set pathErr to getFiles()
if pathErr is not "" then -- if error on some file
  activate
          display dialog "Done, but the creation date of some files have not been changed"
          tell application "TextEdit"
  activate
                    make new document at end of documents with properties {text:("  The creation date of these files have not been changed :" & pathErr)}
  end tell
else
          display dialog "The creation date of all the files have been changed."
end if
on getFiles()
  script o
                    property tFiles : {}
  end script
  set o's tFiles to choose file with multiple selections allowed without invisibles
          set t to ""
          set tError to ""
  set tc to count o's tFiles
  repeat with i from 1 to tc
                    set t to t & " " & quoted form of POSIX path of (item i of o's tFiles)
  if (i mod 250) = 0 or i = tc then -- 250 files sent to the shell to not exceed the limit of characters.
  set r to my setCreationDateToModDate(t)
                              if r is not "" then set tError to tError & return & r
                              set t to ""
  end if
  end repeat
  return tError
end getFiles
on setCreationDateToModDate(theseFiles)
          do shell script "/usr/bin/env python -c 'import os, sys
from Foundation import NSFileManager
df = NSFileManager.defaultManager()
nbr=len(sys.argv)
for i in range( 1, nbr ):
   f = sys.argv[i]
   my_dict, error = df.attributesOfItemAtPath_error_(f, None)
   if error is None:
      mDate = my_dict.fileModificationDate()
      cDateDict = {\"NSFileCreationDate\":mDate}
      b, error = df.setAttributes_ofItemAtPath_error_(cDateDict , f, None)
      if not b: print f' " & theseFiles
end setCreationDateToModDate
Works on OS X 10.5.x or newer.

Similar Messages

  • Changing creation date on adobe acrobat 9

    I've got a folder full of old PDF files at work. They are all labeled DD-MM-YY to signify the date they were made but the pdf's were originally in Word format and when they were all converted to PDF's, they all took that day as their created date. I'm looking for a way to change the created date on these hundreds of PDF's to match the date in the file name. Is there an easy way to do this?  I have to print the documents and organize them chronologically by date.  However, I need to also have corresponding creation dates with the documents.  I'm not good with scripting or programming however I am great at following step by step directions.  I would greatly appreciate help on this since this is a semi time sensitive project.
    Thank you.

    Acrobat does not offer any way to change creation date. It is correct: by definition, it is the day when the PDF was made, it is not supposed to be set to a different date that might be more convenient.

  • Applescript to batch change creation dates (different dates each file)

    I was pointed to an older thread that almost gets me what I need, but I'm not great with applescript, so I'm lost. Basically, I have a bunch of files. The name of the files are in a yyyymmddhhmmss.extension format (such as 20040710141231.mp4). I want to set the creation date of each file to the date by which they are all named. I found the older thread with a similar script and modified it, but I know it's not all there. I can post the whole script, but I'm pretty sure my main issue is with this part:)
                        tell originalFileCreationDate
                                  set myY to year
                                  set myM to text -2 through end of ("0" & (its month as integer))
                                  set myD to text -2 through end of ("0" & day)
                                  set myHr to text -2 through end of ("0" & (its time) div 3600)
                                  set myMin to text -2 through end of ("0" & (its time) mod 3600 div 60)
                                  set mySec to text -2 through end of ("0" & (its time) mod 60 as text)
                        end tell
    I'm not sure how to write that to set the date based on the file name. Can someone point me in the right direction?
    Thanks.

    Try this instead.
    This will change the access and modification times of the file:
    set theDir to choose folder
    do shell script "
    for f in " & POSIX path of theDir & "*
    do
              n=${f##*/}
              if [[ $n =~ ^[0-9]{14} ]]; then
                       touch -t ${n:0:12}.${n:12:2} \"$f\"
              fi
    done

  • Change creation date in a jpeg with exif

    Hi
    how can I set the creation date to t he date the picture was taken according to the exif information?
    Thanks
    Idefix

    try this app: http://publicspace.net/ABetterFinderAttributes/
    Beavis2084

  • Exporting original creation dates with images from IPhoto 08

    Hello experts: I'm trying to create an archival, file-based image storage structure outside of iPhoto 08 (7.1.5). When I use File/Export to add images to the archival file in the Finder, the resulting image is fine but the original creation date of the image is lost, being changed to a different, and later, date. I've tried ways of moving the image, including dragging, cut and paste, transferring the image to Aperture 2 and exporting, etc. and there's no joy. Any suggestions other than manual redos with A Better Finder Rename 8?
    Sierra!Hiker

    Why do you think that the date is lost?
    I suspect that you are confusing photos dates (stored in the EXIF data of the photo and viewable by photo programs) with the file dates which are viewable in file programs like the finder - the finder does not look at photo dates (EXIF) and photo programs do not look at the file date unless there is no EXIF data - the the file date is used by iPhoto
    LN

  • Change creation date of jpeg's to shooting date?

    Does anyone know of a utility that will change the creation date of a jpeg to the shooting date stored in the exif data?
    Phil

    You might try this one, Phil.
    http://www.macupdate.com/info.php/id/11143/a-better-finder-attributes
    Haven't used it or heard any reports one way or another.
    -mj

  • Get a files creation date with UTL_FILE or DBMS_BACKUP_RESTORE.SEARCHFILES

    Hello gurus!
    I have a number of files in the filesystem and i need to find out the names and creation dates of these files. Please do not suggest Java as that is not an option.
    So far i get the names of the files from the SYS side with a procedure that I can call from the user side. The procedure returns an XML string:
    create or replace procedure list_directory(directory varchar2, retResultSet OUT VARCHAR2) is
         ns          VARCHAR2(1024);
         v_directory VARCHAR2(1024);
    BEGIN
          v_directory := directory;
          SYS.DBMS_BACKUP_RESTORE.SEARCHFILES(v_directory, ns);
          retResultSet := '<list>';
          FOR each_file IN (SELECT fname_krbmsft AS name FROM x$krbmsft) LOOP
              --DBMS_OUTPUT.PUT_LINE(each_file.name);
              retResultSet := retResultSet  || '<file>' ||each_file.name|| '</file>';
          END LOOP;
          retResultSet := retResultSet || '</list>';
    end list_directory;Question 1:
    Something like each_file.creation_date would be perfect but it seems like the filename is the only attribute available here from x$krbmsft. Am i wrong? Any other way on the SYS side to get the date?
    Question 2:
    On the users side i could use UTL_FILE to get filesize but not much more valuable information. Can i get the creation date somehow with UTL_FILE or similar?
    Any help is appreciated!

    Anyone got any ideas?Maybe a method as described in Re: Read all file names from Directory. may help (Shows also FileCreationDate).

  • How can I change Time data with List Entry Screen ?

    Hi expert.
    I transfer Time Data (Infotype 2003) via CAT6.
    When I go to transaction PA61 and click List Entry icon.
    Record is display and cannot change data.
    If I wanna change data.I must to click Choose Icon one by one record.
    How can I change data with List Entry Screen?
    ps. If record create via PA61. I can change data with List Entry Screen.
    I can't change with record that create via CAT6.
    Best Regards.

    have u tried to change your time entry through CAT2 tcode, ithink if u have created profile for time entry then it should allow you to change and you can use esc otherwise, its generally the standard profile given by SAP. but is 4 one user
    hope this helps
    guds

  • Changed Creation Date

    The creation date on all my photos in 6 catalogs has changed to 01-05-11. This includes photos that were taken in the past few months. I don't know when the change happened. Any clues as to what is going on?

    Beat,
    When I posted the question I thought it was only the dates in the metadata - all of them. I just discoverd that all the file creation dates on my "Photography" hard drive now show as 01-05-11. This drive holds 8 LR catalogs and a wide assortment of other files related to my photo work. It is starting to look like a non-LR issue. I'm checking now to see if the change occured near the time I did a recent LR update.
    Thanks for looking. I'll post more info after I have done some more digging.
    Ed

  • How do I change creation dates of scanned photographs?

    I have just scanned thousands of old photos into my computer, and would now like to change their creation dates to reflect when the photos were actually taken (some as far back as the early '70s) -- that way I can organize them chronologically in iPhoto.  Is there any way to do this?
    Thanks!

    Select a [photo (or photos) and use the Batch Change time and date command to set the date or a scanned photo
    LN

  • Finder changed creation date on my picture files after upgrading to 10.5

    maybe somebody on that forum can help me. I installed Leopard on my Macbook pro. it works ok a bit sluggish not as smooth as the old tiger. But my biggest problem all my pictures (wedding photos of clients) the creation date in finder has changed to Dec31 1903 9am or 8am. Anybody has a clue how i can reset that or are all creation dates are lost

    Welcome to the forums... unfortunately SMB issues are not fully mainstream.
    Anyhow, I have scanned the change log of files touched by the update (searching for SMB - original list courtesy of Rixstep). This yielded:
    /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist
    /private/etc/smb.conf
    /System/Library/CoreServices/SmbFileServer.bundle/Versions/A/Resources/DesktopDe faults.plist
    /System/Library/LaunchDaemons/com.apple.smb.server.preferences.plist
    /System/Library/LaunchDaemons/com.apple.smbfsloadkext.plist
    /System/Library/LaunchDaemons/smbd.plist
    /private/etc/smb.conf.template
    /System/Library/Extensions/smbfs.kext
    /System/Library/Extensions/smbfs.kext/Contents/CodeDirectory
    /System/Library/Extensions/smbfs.kext/Contents/CodeRequirements
    /System/Library/Extensions/smbfs.kext/Contents/CodeResources
    /System/Library/Extensions/smbfs.kext/Contents/CodeSignature
    /System/Library/Extensions/smbfs.kext/Contents/Info.plist
    /System/Library/Extensions/smbfs.kext/Contents/MacOS/smbfs
    /System/Library/Extensions/smbfs.kext/Contents/Resources/load_smbfs
    /System/Library/Extensions/smbfs.kext/Contents/version.plist
    /System/Library/Filesystems/smbfs.fs
    /System/Library/Filesystems/smbfs.fs/Contents
    /System/Library/Filesystems/smbfs.fs/Contents/Info.plist
    /System/Library/Filesystems/smbfs.fs/Contents/Resources
    /System/Library/Filesystems/smbfs.fs/Contents/Resources/English.lproj
    /System/Library/Filesystems/smbfs.fs/Contents/Resources/English.lproj/InfoPlist. strings
    /usr/lib/sasl2/smb_lm.so
    /usr/lib/sasl2/smb_nt.so
    /usr/lib/sasl2/smb_ntlmv2.so
    /private/var/db/smb.conf
    Items highlighted in bold could be relevant.
    Have you checked that your entry in nsmb.conf is intact? If it is, could it be overridden by a change to one of the other conf files (or a plist)?

  • Get the data with more than one of the desired value

    Hi,
    I need to pull the records with more than one value of 'Other' on the delivery days fields.
    The delivery fields are mon,tue,wed,thu,fri and sat that tells the where the item will be delivered. The value can be Home, Work, or Other.
    Here is the Sample data:
    cust_id: 123
    item: newspaper
    mon: Home
    tue:Work
    wed: Other
    thu: Home
    fri: Other
    sat: Other
    And here is my query so far.
    select
    cust_id,
    item,
    mon,
    tue,
    wed,
    thu,
    fri,
    sat,
    sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1
    else 0 end) as day_ctr
    from customer
    Could you please help me with the right formula I need to get this?
    Thank you in advance..

    First
    DESC customer
    Second
    Can you explain what you are trying with
    sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1 else 0 end) as day_ctr
    Third
    Usually it's helpful a example of the result you want...
    Perhaps you want this
    select DECODE(mon,1,(select distinct mon from customer), 'OTHER') mon,
            DECODE(tue,1,(select distinct tue from customer), 'OTHER') tue,
            DECODE(wed,1,(select distinct wed from customer), 'OTHER') wed,
            DECODE(thu,1,(select distinct thu from customer), 'OTHER') thu,
            DECODE(fri,1,(select distinct fri from customer), 'OTHER') fri,
            DECODE(sat,1,(select distinct sat from customer), 'OTHER') sat from
    select
    COUNT(DISTINCT mon) mon,
    COUNT(DISTINCT tue) tue,
    COUNT(DISTINCT wed) wed,
    COUNT(DISTINCT thu) thu,
    COUNT(DISTINCT fri) fri,
    COUNT(DISTINCT sat ) sat
    from customer
    )

  • Batch change creation date meta data in Bridge?

    In Lightroom i can change the meta data on multiple files to be increased by say 2 minutes and all the creation times are adjusted.  Can this be done in CS4 bridge???

    In Bridge you can not change the date created.  That is time stamped by camera when you take the picture.

  • File info templates change creation date

    I created a couple of file info templates a number of years ago to apply to my pictures.
    However, whenever I apply these templates in PS (CS2, CS3 & CS4) the creation date of the photograph automatically changes to the creation date of the template!
    Is there a way of preventing this irritating problem?
    THANKS

    I created a couple of file info templates a number of years ago to apply to my pictures.
    However, whenever I apply these templates in PS (CS2, CS3 & CS4) the creation date of the photograph automatically changes to the creation date of the template!
    Is there a way of preventing this irritating problem?
    THANKS

  • Can't change creator type with AppleScript

    I'm trying to change the file type and creator type of some files using AppleScript. I've found many examples telling me how to do it. My problem is, that no matter what I try, the creator type does not change. Yes, I can change the file type, but using the same syntax for the creator type fails to make any change. There is no error; rather, the creator type simply remains what it was before.
    I'm doing this on 10.6.8, but I also tried it on 10.8.4 and had the same issue.
    Here's an example script:
    After executing on a single file (for example), the alerts show that the file type has been changed, but the creator type HAS NOT, and remains what it was previously.

    Hello
    Firstly, I have posted wrong handler, which should have been:
    on set_creator_code(f, c)
            string f : POSIX path of target file
            string c : 4-character creator code (or "" to set 0x00000000)
        do shell script "/usr/bin/perl <<'EOF' - " & f's quoted form & " " & c's quoted form & "
    die \"Usage: $0 <file> [<creator code>]\" unless @ARGV > 0;
    my ($f, $c) = @ARGV;
    (my $finfo = qx[xattr -p com.apple.FinderInfo \"$f\" 2>/dev/null]) =~ s/[[:space:]]//og;
    $finfo = \"00\" x 32 unless $finfo;
    my $cccc = unpack('H8', $c . \"\\0\\0\\0\\0\");
    $finfo =~ s/ ^((?:..){4}) ((?:..){4}) /$1$cccc/ox;
    qx[xattr -w -x com.apple.FinderInfo \"$finfo\" \"$f\"];
    EOF"
    end set_creator_code
    * The previous (wrong) handler will create wrong data when there's no com.apple.FinderInfo attribute of the file. Sorry.
    By the way, this handler is written to set creator code to \0\0\0\0 when c = "". So the script below will do what you want for a file.
    set f to choose file
    set_creator_code(f's POSIX path, "")
    As for recursive processing, it is straightforward but the question is how to determine the target files. Processing every file under a given directory tree could be too broad and potentially dangerous. Can we assume the target files are all html and its name extension is .html or .htm? If so, the script below will do what you want:
    set d to choose folder
    set_creator_code_recursively(d's POSIX path, "(html|htm)", "")
    on set_creator_code_recursively(d, e, c)
            string d : POSIX path of target directory
            string e : name extension pattern (case insensitive), e.g., (html|htm|css)
            string c : 4-character creator code (or "" to set 0x00000000)
        do shell script "/usr/bin/perl <<'EOF' - " & d's quoted form & " " & e's quoted form & " " & c's quoted form & "
    die \"Usage: $0 <directory> <name extension pattern> [<creator code>]\" unless @ARGV > 1;
    my ($dir, $ext, $code) = @ARGV;
    local $/=\"\\0\";
    my @ff = map {chomp; $_} qx[find -E \"$dir\" -type f -iregex '.*\\\\.$ext\\$' -print0];
    for my $f (@ff) {
        (my $finfo = qx[xattr -p com.apple.FinderInfo \"$f\" 2>/dev/null]) =~ s/[[:space:]]//og;
        $finfo = \"00\" x 32 unless $finfo;
        my $cccc = unpack('H8', $code . \"\\0\\0\\0\\0\");
        $finfo =~ s/ ^((?:..){4}) ((?:..){4}) /$1$cccc/ox;
        qx[xattr -w -x com.apple.FinderInfo \"$finfo\" \"$f\"];
    EOF"
    end set_creator_code_recursively
    Hope this may help,
    H

Maybe you are looking for

  • Web Server Aliases not working!!

    I have set up a virtual domain "internal.blahblah.com" within that I have setup Web Server Aliases. However, I cannot get them to resolve for the life of me! I tried somthing as simple as * . No go when I enter "server.internal.blahblah.com". Anyone

  • Can I use Upsell package to go from 7 Pro to X Pro?

    As title - the blurb for the Upsell package says to use it you must have: Adobe Acrobat Standard 7, 8, 9, or X Adobe Acrobat 3D Adobe Acrobat Pro Extended 7, 8, or 9 Does this really mean I can't use an Upsell package to go from 7 Pro to X Pro?

  • Unable to create a subtask within a task for cProjects

    Hi All, I am unable to create a subtask within a task using BAPI_BUS2175_CREATE. When I pass the GUID of the project definition and fill the corresponding task structures to the BAPI, a task gets created at the phase level. But when I pass the GUID o

  • Cannot drag and drop a layer(s) from 1 PS file to another.

    Hello, I have just installed PS CS5.1 and used 64bit version (Yes, I have restarted my PC). I have found 2 problems straight away: when you are trying to drag and drop images from layers panel to another PS file (see image above), it won't do it like

  • PERSONAL DEVELOPMENT APPRAISALS (BW-HR Report)

    Hi, My requirment is to develop a BW Report on Following HR Information. Staff ID Staff Name Organisational Unit Pay Scale Group Pay Scale Level Performance Rating Salary FTE Pay Scale Group Effective Date Time Spent in Pay Scale Group Job Name Posit