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

Re: Re: last modified file - how to catch?


  • Subject: Re: Re: last modified file - how to catch?
  • From: Omar K N <email@hidden>
  • Date: Mon, 07 Jul 2014 16:21:14 +0200



Hi & good day,

Let me please ask 4 (related) questions:

On 07 Jul 2014, at 04:04, email@hidden wrote:

1.) 

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

This did work (of course).

But when applying to the path here, I cannot write the correct path in the 1st line:

set _path to POSIX path of (path to folder "_Output" of folder "Documents" of home as text)
set lastModifiedFile to first paragraph of (do shell script "ls -Ft " & quoted form of _path & " | sed -E '/\\/$/d'")

--------------------------------..————————————————

2.)

The other script also worked when applied to the Downloads folder:

set _fldr to path to downloads folder

tell application "Finder"
set lastFile to (last item of (sort files of _fldr by modification date)) as alias
end tell


but when I set it to my _Output folder, it doesn’t work:

set _fldr to "MacHD:Users:okn:Documents:_Output"

tell application "Finder"
set lastFile to (last item of (sort files of _fldr by modification date)) of alias
get lastFile
end tell

Error:
Can’t get every file of "MacHD:Users:okn:Documents:_Output”

--------------------------------..————————————————4.)

3.)

Also,
is it advised to use an alias for often accessed folders? 

set _pOutput to folder "_Output" of folder "Documents" of home as alias

--------------------------------..————————————————

5.)

Lastly, how to enter a variable result into the dialog, below is of course a text string only?

display dialog "Latest file found [lastFile]" buttons {"OK”}



with best regards,
Omar K N
Stockholm, Sweden
(Hot today!)
 _______________________________________________
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: last modified file - how to catch?
      • From: Luther Fuller <email@hidden>
    • Re: last modified file - how to catch?
      • From: Thomas Fischer <email@hidden>
  • Prev by Date: Re: last modified file - how to catch?
  • Next by Date: 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