Changing the creation dates of a document.

Is it possible to change the creation dates of a microsoft office document (as shown in document properties?) I have been told that there is a built-in command within the os that allows the user to change the creation date on a file. Is this true?

My career could depend on this....

2 Ghz Intel Core Duo, Mac OS X (10.4.6)

Posted on Sep 19, 2006 3:48 AM

Reply
11 replies

Sep 19, 2006 5:23 PM in response to Popstart

Not within the Office apps. All you can do is include a creation date field within the document and change that information (see Help->search for creation date). Although you can modify that information, you can't change the creation date as shown in properties. For that you'll need something like ResEdit (OS 9 and earlier stuff) or maybe File Buddy (http://www.skytag.com/filebuddy/en/9/index.html).

Sep 19, 2006 6:05 PM in response to Popstart

The command you are referring to is "SetFile", a UNIX command. It is not on OSX by default but when you install Xcode it is included. You can probably download it individually from http://corz.org/osx/soft/stuff/setfile.gz.

When you download it, move it to where it should be with Terminal command:

sudo mv ~/Desktop/setfile /usr/local/bin/

Then make the file UNIX executable like this:

sudo chown root:admin /usr/local/bin/SetFile;sudo chmod 775 /usr/local/bin/SetFile

You invoke the command like this:

/usr/local/bin/setfile -d 02/26/2003 ~/Desktop/setfile.gz

This example uses the downloaded file but replace whatever your filepath and numbers you want.

Hope that saves yur career.

Sep 19, 2006 6:12 PM in response to Gnarlodious

Gnarlodious:

Thanks. I forgot that SetFile can also modify creation dates. I use it primariy for making files visible and invisible.

Popstart:

Make sure that you also get the manpage for SetFile and read how to use it. BTW, if XCode is installed, you don't have to change anything. Just ensure that you give it's path when running it in Terminal.

Sep 19, 2006 7:49 PM in response to baltwo

I can't see how it would be justified to put 2 gigabytes of unwanted junk on your HD just for one measly UNIX manpage. I guess the SetFile command is a barebones utility command and so the instructions are embedded in the file.

When the Xcode installer runs, one of the many things it does is to change the command search path(s) to command files. With Xcode installed, you don't need to specify the entire path to the command like I did above. You can set your path persistently but it's not something a beginner would do.


In any case, I had written an Applescript to look for the location of SetFile and install it if not already. It looks like this:
(some parts may not work anymore)

-- http://Gnarlodious.com/Apple/AppleScript/
-- version 12/20/2004

property fileUtilityPath : "/Developer/Tools/SetFile"
set SetFileURL to "http://corz.org/osx/soft/stuff/setfile.gz"

-- is Xcode installed?
do shell script "ls Developer/Tools/SetFile"
if (do shell script "ls " & fileUtilityPath) = "" then
display dialog "Xcode is not installed"
set fileUtilityPath to "ls /usr/local/bin/SetFile"
if (do shell script "ls " & fileUtilityPath) = "" then -- if the SetFile utility is not found, install it

display dialog "Error... SetFile not found" & return & "Please install the SetFile utility to enable changing the file creation date" buttons {"Download it", "Quit"} default button 1 with icon caution
if the button returned of the result is "Download it" then
-- download and install the file ... NO ERRORCHECKING HERE!
do shell script "curl " & SetFileURL & " > $HOME/Desktop/SetFile.gz"
do shell script "gzip -d < $HOME/Desktop/SetFile.gz >> $HOME/Desktop/SetFile ; mv $HOME/Desktop/SetFile /usr/local/bin ; chown root:admin /usr/local/bin/SetFile;sudo chmod 775 /usr/local/bin/SetFile" with administrator privileges

else if the button returned of the result is "Quit" then
return
end if
end if
end if


-- further script to do whatever with file dates

Sep 20, 2006 1:58 AM in response to Popstart

Thanks, Guys.

The problem was that I had produced some documents as evidence in a work dispute: their validity has been challenged on the grounds that I may have tampered with the creation dates.

So it seems that there is not a command line built into the OS that does the job (as the work PC tecnician claimed)and the only way is by installing X tools, which I neither have nor need. And I wouldn't know how to do it either.

Thanks again.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Changing the creation dates of a document.

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