change "date added" of a file?

Discussion in 'macOS' started by .mark., Feb 28, 2008.

  1. .mark. macrumors 6502

    May 28, 2007
    Jersey, C.I.
    I'm using the drawers icons with stacks in leopard and I love them. The only problem I'm having is with the icon for the download stack. The meta data is set ok for the date modified and date created but i want to order the stack by date added. I googled around a bit and found that using the touch command from the terminal you can edit the date modified and created but does anyone know how I can modify the a file's "date added" so I can have the stack ordered by date added and keep my icon at the front?
  2. todd2000 macrumors 68000

    Nov 14, 2005
    Danville, VA
    Found this thread while searching Google. I would like to know this too, there must be a way through terminal or something?
  3. MagicTom macrumors newbie

    Jun 25, 2007
    Another one coming through Google. This is really frustrating -- Date Modified just isn't cutting it here!
  4. Mitthrawnuruodo Moderator emeritus


    Mar 10, 2004
    Bergen, Norway
  5. pats-madin macrumors newbie

    Dec 29, 2007
    If you change the date on your computer to the date you want and save the files with a different name then it'll save it with that date... although with a lot of files this would be really tedious... and dont forget to change the date back
  6. dvd macrumors regular


    Oct 12, 2007
    hmmm, per this interesting thread from another site the Date Added field is not going to be an easy thing to tweak.. looks like it's buried in an SQLite database, ~/Library/Preferences/ and not something easy to tweak with touch like the ctime, mtime, or atime.
  7. Sobtanian macrumors newbie

    May 15, 2008
    Hello, stumbled here via google also :)

    Having not found an easy way to change the Date Added variable, I wrote a small script that does the following:

    Every time a file is added to the Downloads folder, it deletes the drawer icon and copies it back in, hence making it the last file added, ie on top of the stack :) The delete is direct (ie no trash can).

    Using the script is easy, all the instructions are within it. Just download the attached .zip and put it in ~/Library/Scripts/Folder Actions Scripts. Unzip it there and open the cdo.scrpt file for further instructions.

    This is a very crude fix, and the script just runs a CLI script to delete and copy the folder icon. Still, it works and will let us have a nice stack with an icon that is arranged by Date Added.

    Hope this helps until someone more clever fixes it properly ;)

    Any questions let me know.

    Attached Files:

      File size:
      3.3 KB
  8. Dany M macrumors 6502

    Jun 18, 2007
    what does ~ mean again, home library or the mac hd library???

    I tried doing thos but it is not working?
  9. dvd macrumors regular


    Oct 12, 2007
    ~ = the user's home directory

    more specifically

    ~ = your home directory
    ~bob = bob's home directory
  10. Dany M macrumors 6502

    Jun 18, 2007
  11. ImNotJimboJones macrumors newbie

    Dec 19, 2007
    As far as i can see, the only effective way to keep a file/folder on top of a stack using "Date Added" sorting is to move the file/folder via applescript as in Sobtanian's post.

    For the curious, one can easily edit the SQLite database file ~/Library/Preferences/ to change the order of the files in a stack. Unfortunately, this is a futile effort toward our goal. When a new file is added to a stack, a new entry is added to the database with the order number set to one more than the highest order number presently in the database. In other words, if you change the order number of your stack overlay to 99999999998, the next file added to the stack will be given the order number 99999999999, putting it on top.
  12. belvdr macrumors 603

    Aug 15, 2005
    What if you go to Terminal and do a:
    touch <directory or filename>
  13. ImNotJimboJones macrumors newbie

    Dec 19, 2007
    That would be a solution to sorting by Modification Time... This thread is related to sorting by Date Added.
  14. Mark Lee macrumors newbie

    Nov 22, 2009
    Sorry for necro-posting. Found thins thread via Google, but didn't like the solution of a script. So I found a solution with Folder Actions in Automator.

    Here are the steps:
    1. (just a screenshot of the actions)
    2. File -> Save -> Enter the name for your new action.

    Now everytime any file goes to the Downloads folder, the Folder Action runs automatically and moves the icon file back and forth making it the last file added to the folder.
  15. ImNotJimboJones macrumors newbie

    Dec 19, 2007
    That works too, but believe it or not, both solutions are identical. The only difference is that you are using Automator to write your folder action rather than straight applescript. As a software engineer, I naturally think in code and don't mess with Autormator much, but your method is obviously an easy shortcut, so virtual high-five on that. ;)
  16. dburr macrumors newbie

    May 15, 2015
    If you own Noodlesoft's Hazel, doing this is trivial and doesn't require Folder Actions to be enabled separately. Here's how I did it. I created a new rule for the Downloads folder, I called it "Move Downloads Icon to Top." Here's how I set up the rule. (Note: any text after a "#" sign is a comment from me and is not part of the rule)

    If ALL of the following conditions are met:
    * Any File
    * Name does not contain ".download" # otherwise every time you start downloading a file in Safari, this rule would fire
    * Name does not contain "Download" # my download drawer icon is named "", so we don't want the rule to trigger whenever it gets re-copied in

    Do the following to the matched file or folder:
    * Run shell script:
    cp -a $HOME/Downloads/*ownload*.app /tmp; rm -rf $HOME/Downloads/*ownload*.app; cp -a /tmp/*ownload*.app $HOME/Downloads

    # Note that my version copies the file into /tmp, deletes it, then re-copies it back in, avoiding the need to keep a template copy of it in some other location.
  17. DennisBlah macrumors 6502


    Dec 5, 2013
    The Netherlands
    'A better finder attributes' is worth trying, its simple to use and helped me out a lot of times with an 'autoUpdater' application I created for the company.

Share This Page