• 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: last modified file - how to catch?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: last modified file - how to catch?


  • Subject: Re: last modified file - how to catch?
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 06 Jul 2014 20:00:06 -0500

On Jul 06, 2014, at 19:29, Shane Stanley <email@hidden> wrote:
Except it unfortunately fails when there are package files involved.
______________________________________________________________________

Hey Shane,

Eh?  How so?  (On 10.9.4).

set _path to POSIX path of ((path to downloads folder as text) & "2014.05.21 · 23.57.46 { Gathered }:")
set lastModifiedFile to first paragraph of (do shell script "ls -Ft " & quoted form of _path & " | sed -E '/\\/$/d'")

--> "Cytozyme-Trachea { Mesenchyme }.odt"

set _path to POSIX path of ((path to downloads folder as text) & "2014.05.21 · 23.57.46 { Gathered }:")
set fileList to (do shell script "ls -Flt " & quoted form of _path)

Result:

"total 116688
-rw-r--r--@ 1 chris  staff     23373 May 21 23:19 Cytozyme-Trachea { Mesenchyme }.odt
-rw-r--r--@ 1 chris  staff     40526 May 21 23:04 Dilbert { 2014.05.21 }.gif
-rw-r--r--@ 1 chris  staff  53713770 May 20 11:37 Safari 7.0.4 Mavericks.pkg
-rw-r--r--@ 1 chris  admin   5769264 May 16 06:53 MailFollowUp 1.6.4.dmg
-rw-r--r--@ 1 chris  staff    191899 May 13 02:47 ASObjCExtras_stuff.zip"

Note the package file.

I also note that on my Mac (10.9.4) the Finder seems to be including .DSStore files in my example (which is essentially the same as yours).

You said Finder.  Do you mean from this?

tell application id "com.apple.finder"
(sort files of desktop by modification date)
end tell

That doesn't show any invisibles here.

Or do you mean 'ls'?

It should not show any 'dot' files without the -a switch.

--
Take Care,
Chris

 _______________________________________________
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

References: 
 >last modified file - how to catch? (From: okn <email@hidden>)
 >Re: last modified file - how to catch? (From: Christopher Stone <email@hidden>)
 >Re: last modified file - how to catch? (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: last modified file - how to catch?
  • Next by Date: Re: last modified file - how to catch?
  • Previous by thread: Re: last modified file - how to catch?
  • Next by thread: Re: last modified file - how to catch?
  • Index(es):
    • Date
    • Thread