On error the error_message number the error_numberĭisplay dialog "Error: " & the error_number & ". " & return & "Images processed: " & images_changed & return & "Images skipped: " & (count of images_skipped) & return & return & images_skipped Set images_changed to (images_changed + 1)ĭisplay alert "Task completed! " & return & "Folder has " & files_in_folder & " files, of which " & image_files_in_folder & " image files. Set dateTimeOriginal to ((characters 35 through -1 of dateTimeOriginal) as string)ĭo shell script "touch -t " & dateTimeOriginal & " " & filePathSH Set images_skipped to images_skipped & (this_file_name & ", ") Set dateTimeOriginal to do shell script "/usr/local/bin/exiftool -d '%Y%m%d%H%M.%S' -DateTimeOriginal " & filePathSH Set filePathSH to quoted form of the POSIX path of filePathAS Set progress additional description to "Processing file " & this_file_name Output photos that don't have datetimeoriginal to a CSV Note this can take a long time if you have a lot of jpgs You'll need to set your Dropbox folder path. Set this_file_name to (name of (info for this_file)) Find images in a directory that don't have a DateTimeOriginal exiftool -filename -filemodifydate -createdate -r -if ' (not datetimeoriginal) and filetype eq 'JPEG''. Set this_file to (item i of these_files as alias) Repeat with i from 1 to the count of these_files Set progress total steps to (count of these_files) Set progress additional description to "Begin process" Update the initial progress information Set image_files_in_folder to count of these_files Set these_files to every file of folder this_folder whose name does not start with "." and (name extension is "jpeg" or name extension is "JPEG" or name extension is "jpg" or name extension is "JPG") Set files_in_folder to count of these_files Set these_files to every file of folder this_folder whose name does not start with "." Set this_folder to (choose folder with prompt "Pick the folder containing the images to process:") as string A lot of other files I tried have both values the same. Note the 1-sec difference in the seconds field. Set progress completed steps to images_changed Here's example output from a JPEG file of mine: Code: kMDItemContentCreationDate 10:27:25 -0700 kMDItemFSCreationDate 17:27:24 -0700 kMDItemFSCreatorCode ''. Set progress additional description to "Preparing to process." Set progress description to "Processing Images." Set theTagValue to text 1 thru -3 of theTagValue & "." & text -2 thru end of theTagValueĭo shell script "touch -t " & theTagValue & " " & quoted form of fileName as POSIX file Set theTagValue to do shell script "echo " & quoted form of theTagValue & ¬ display dialog fileName & return & theTagValue Set theFileList to (every file in entire contents of folder POSIX file "/Users/fran/Desktop/Carpeta/" whose name extension = "jpg") as alias list This script will change de "creation date" shown in finder of every file in /Users/fran/Desktop/carpeta to the date saved on EXIF information of each file BUT I DON'T KNOW HOW TO MAKE IT TO CONTINUE IN CASE THERE IS NO EXIF INFO IN A FILE. It doesn't work properly some times (when the pictures have no EXIF information ). I could copy and paste several applescript fragments altoghether. Not perfectly, but well enough even though I am an applescript newbie. I just had the same problem and I could solve it.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |