• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Creating a script that can set its own modification date
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Creating a script that can set its own modification date


  • Subject: Creating a script that can set its own modification date
  • From: "David A. Cox" <email@hidden>
  • Date: Wed, 28 Nov 2007 16:50:00 -0800 (PST)

I am stumped, and I hope someone can point out an easy fix for me.

I am working on a script, and I would like to set its modificaiton date to some date far in the future, so that it sorts at the top of finder list which is sorted by modificaiton date. I was hoping to be able to add something to the script so that every time it was run, it would make sure its modificaiton date was nice and far into the future.

Creating a script with the contents:

tell application "Finder"
	do shell script "touch -t 202102211322 " & quoted form of POSIX path of (path to me)
end tell

works fine when run from script editor (the file is updated with the correct future date). But when the script is run from the finder itself, the date changes for a moment, but then that future date is replaced with the current date and time. I can see why it would be able to tell that it is changing itself, and then reflect that info. But that is not what I want :).

Anyone know of a way to make a script set a false modification date on itself?

DAC
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Creating a script that can set its own modification date
      • From: Christopher Nebel <email@hidden>
    • Re: Creating a script that can set its own modification date
      • From: Christopher Nebel <email@hidden>
    • Re: Creating a script that can set its own modification date
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Timed loop
  • Next by Date: Re: Creating a script that can set its own modification date
  • Previous by thread: Re: If statements in Excel
  • Next by thread: Re: Creating a script that can set its own modification date
  • Index(es):
    • Date
    • Thread