• 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: Modification date in leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modification date in leopard


  • Subject: Re: Modification date in leopard
  • From: KOENIG Yvan <email@hidden>
  • Date: Mon, 3 Mar 2008 09:48:59 +0100


Le 3 mars 2008 à 00:23, John Baltutis a écrit :

On 03/02/08, david <email@hidden> wrote:

In 10.4 I could use

set d to modification date of file "system:private:tmp:test"

to get the modification date of a file. In 10.5 this doesn't work anymore.
I guess I could use a shell script but that feels like a lot of hassle.
There must be built in support for this in Applescript but Google didn't
find anything.

I can't answer the question, directly. But, I just did these in 10.5.2.


This errors:


set p2s to "/private/tmp/<name of file>" as text result set d to modification date of (get info for file p2s) result

-> tell current application
	info for file "/private/tmp/<name of file>"
		"File /private/tmp/<name of file> wasn't found."

Whereas, this works:

set p2s to "/private/tmp/<name of file>" as text
result
do shell script "cat " & p2s
result

l-> tell current application
	do shell script "cat /private/tmp/cups_noproof_log"
		 "file's contents"
end tell

Maybe it's a permissions thing WRT things buried in /private/tmp/. However,
copy the file to the Desktop, and then the first works:


set p2s to ((path to desktop) & "<name of file>") as text
result
set d to modification date of (get info for file p2s)
result

->date "1/March/2008 3:21:58 PM"

Sounds like something for Sir Nebel toanswer.

Hello John

The problem was not with "info for".
It was that the OP was neither using info for, nor enclosing the instruction in a tell block.


I asked a complementary question :

is  "system:private:tmp:test" a correct pathname?

On my system (10.4.11), it doesn't work.

I tested with that:

set p2s to (path to system folder) as Unicode text

tell application "Finder"
	set md1 to get modification date of (p2s as alias)
	--	set md2 to get modification date of file "system:"
end tell
tell application "System Events"
	set md1 to get modification date of (p2s as alias)
	set md2 to get modification date of file "system:"
end tell

And, as far as I know, it's perfectly normal.

Yvan KOENIG _______________________________________________
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: Modification date in leopard
      • From: david <email@hidden>
References: 
 >Re: Modification date in leopard (From: John Baltutis <email@hidden>)

  • Prev by Date: Re: Modification date in leopard
  • Next by Date: Re: Safari - email contents
  • Previous by thread: Re: Modification date in leopard
  • Next by thread: Re: Modification date in leopard
  • Index(es):
    • Date
    • Thread