Neither cp(1) with -p option nor ditto(1) will preserve creation date if file is copied within FAT volume. As far as I have tested, both cp(1) with -p option and ditto(1) can preserve creation date if file is copied to HFS+ volume. But if you use cp(1) without -p option, creation date is not preserved and set to the time when the copy is made. If you copy file via Finder, creation date would be most likely preserved even in FAT volume. Script is briefly tested under OS X 10.6.8.īy the way, file's creation date may or may not survive copy operation. _main((choose folder with prompt "Choose template folder")'s POSIX path) Using exiftool 10.04 which is assumed to be installed at /usr/local/bin/exiftool Please read comments in script for more details. If DateTimeOrigin is not retrieved, file system creation date is used. Here's a revised AppleScript script using exiftool to retrieve DateTimeOriginal metadata from media file. It took me a while to explore mighty exiftool. Set fromUnix to do shell script "ls -l " & quotedUnixDesktopPathĭisplay dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix Log "quoted form is " & quotedUnixDesktopPath Set quotedUnixDesktopPath to quoted form of unixDesktopPath Log "unixDesktopPath = " & unixDesktopPath Set unixDesktopPath to POSIX path of desktopPath Set desktopPath to (path to desktop) as string
Log " - Starting on " & ((current date) as string) & " - " Here is an example.ġ) Click on the Event Log tab to see the output from the log statement Statements to your script to see what is going on. It is easier to diagnose problems with debug information.
How to run a Unix ( Terminal ) command from inside of an Applescript.
I’ve looked at a few scripts and tried to combine them to do all of this but with no joy.Īny help/clarity in this, would be awesome. Once the folder structure has been duplicated/created move all media files from PART 1 to the relevant folders in PART 2 Where _xx appears would be replaced with the same naming convention as the media files in Part one (but the date used is the earliest date of a file in the specified folder - preferably displayed in a way that could be edited if needed).įolder structure to be duplicated/created:įinal folder structure duplicated/created: I would then like to duplicate/create an existing folder structure (some folders containing files inside i.e. Title: should be arbitrary text entered via a text box. Subject to be obtained from a dropdown of optionsģ. I’m looking to…Ĭopy all my files, (images and videos) from an external hard drive to a specified folder on my computer and then rename all media files to the following format Ĭreation date_subject_title_original file name = YYYYMMDD_subject_title_IMG_1234.jpgĢ. Hi guys, I know I may be asking for something that is a little complex (for my brain anyway) so I won’t be too surprised if I don’t get any responses to this post.