Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I add time/date stamp to my screen capture file names?

I'm on mac osx.

I'm trying to add time/date stamp to my screen capture file names. (at the moment it's just 'Picture 1' etc..)

I've tried the following command in terminal but have not had success. please help!!


defaults write com.apple.screencapture name "datestamp" at "timestamp"


killall SystemUIServer

Mac OS X (10.5.8)

Posted on Jul 4, 2012 3:08 AM

Reply
4 replies

Jul 4, 2012 6:22 AM in response to snaggle101

In OS X Lion, the default filename is "Screen Shot yyyy-mm-dd at hh.mm.ss.png" for a ping file.


As for your current approach...


The defaults write works with plist files, and the syntax is usually (much) simpler than what you've shown. In general, the defaults command syntax is this:


defaults write general-component key-name set-key-to-this


I'm not sure where you got that syntax. Do you have a URL I can look at with some documentation?) or some other reference?


For the lower-level operations of the command, here's the terminal command showing the general command syntax:


screencapture -h


and I don't see anything there that references the metadata. (But then I'm also running Lion, and things do occasionally change around here.)


I don't know that there's a way to do this within Screen Capture itself, but it's certainly feasible to add metadata to various image file formats after the fact. The general standard for this sort of thing is exchangeable image file format (Exif), and there are various tools around to manage Exif data.


To meet your current requirements, I'd expect to need a post-processing step using a locally-written script (written in bash, Python, AppleScript or such), reading off the metadata from the file - either the file system metadata, or the Exif data) and then renaming the matching file(s).


Alternatively, an upgrade to a newer version of OS X might be possible (depending on your hardware), as the file name selection does seem to do more or less what you want in newer versions of OS X. (We'll see what Mountain Lion does here sometime later this month.)

Jul 4, 2012 6:39 AM in response to snaggle101

Surely someone else will provide a better solution. Meanwhile, however, you might want to try the following script. Copy and paste the script into the AppleScript Editor's window and save it as an application. Then drop your screen capture files on the droplet's Finder icon.


on opentheDroppedFiles

tell application "Finder"

repeat with thisFile in theDroppedFiles

set theFileName to name of thisFile

if (word 1 of theFileName is "Picture") and ¬

(word 2 of theFileName = word -2 of theFileName) then

set theExtension to name extension of thisFile

set P to offset of theExtension in theFileName

set theCreationDate to creation date of thisFile

set dateStamp to short date string of theCreationDate

set timeStamp to time string of theCreationDate

set name of thisFile to "Screen Shot " & dateStamp ¬

& " at " & timeStamp & "." & theExtension

end if

end repeat

end tell

end open


Message was edited by: Pierre L.

Jul 4, 2012 6:55 AM in response to MrHoffman

hmm. thank you both for that, it does seem quite complex though.


I thought there might be a simple way to change the file name, as you would the file type/drop shadow etc.


I mean I can change the name through terminal to other words instead of "picture" but it still continues as 01, 02, 03 etc.


I just wanted to have it named with the date and time, but perhaps this just isn't possible on my current version of the system.


??

Jul 4, 2012 7:37 AM in response to snaggle101

hmm. thank you both for that, it does seem quite complex though.


Saving a script as an application (a droplet in this case) via AppleScript Editor is not at all complex. Once that's done, you would just have to drag and drop you screen capture files onto the droplet's Finder icon to have their name changed exactly as you were asking for. Admittedly not the best solution, but surely not a complex one.

How do I add time/date stamp to my screen capture file names?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.