• 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
RE: Re: Change modification date of a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Re: Change modification date of a file


  • Subject: RE: Re: Change modification date of a file
  • From: email@hidden
  • Date: Wed, 09 Nov 2011 16:33:27 +0100

Hi Bert,


Ran the test on a unix server using helios to mount the 'afp' volumes where I could not replicate the behavior you mentioned
Are you working on a windows server? This I can not test then....


--- spaces problem

set THEPATH to "BEL_Tester2:test mod:Untitled.rtf"

do shell script "touch " & quoted form of POSIX path of THEPATH



--- copy instead of rename/move
use cp instead of mv


best regards,jan





Hello Jan, thank you for your answer.I had some complications testing with the "touch" script.
1) It seems to work fine with files on my local harddisk.
2) I had one situation in which I (or better: the script) was able to change the modification date of a file on a server. The strange thing was when I moved the file to another folder (manually in the Finder) the old modification date was back.
3) The script doesn't seem to work if the path to a file contains folders with spaces in the name.


My main script contains HFS paths which I convert to POSIX paths. Maybe something goes wrong there?


Additional question:
Is it also possible to DUPLICATE a file with a do shell script? From one folder to another folder I mean.


Bert.

On 9 nov 2011, at 11:42, email@hidden wrote:

hi bert


do shell script "touch /PATHTOFILE"
do shell script "mv /PATHTOFILE /PATHTOFILE/NEWNAME"


best regards,jan





I am also interested in example code how to change the filename with do shell script . . .




Hello,

I have a simple Finder statement to change the modification date of a file. See below. Every now and then (can't tell why) the task errors.I was wondering: How can I perform same task without talking to the Finder (do shell script bla bla....)? Can anyone help?


set D to current date
tell application "Finder"
set modification date of alias "Macintosh HD:Users:bert:Desktop:Testfolder:week_47.txt" to D
end tell











 _______________________________________________
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

  • Prev by Date: Re: Change modification date of a file
  • Next by Date: Re: Burning DVD's
  • Previous by thread: Re: Change modification date of a file
  • Next by thread: Re: AppleScript-Users Digest, Vol 8, Issue 515
  • Index(es):
    • Date
    • Thread