Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
- Subject: Re: Message -ID, email@hidden, Back and forth between Posix and HFS paths
- From: Cosgrave Valentine <email@hidden>
- Date: Tue, 30 Mar 2010 10:09:14 +0100
Mark,
Just to confirm the script that you provided and works is the script quoted below WITH the n.
The script without the n threw up the error "String found where operator expected at -e line 1, near "$_eq ".DS_Store"" (Missing operator before ".DS_Store"?) syntax error at -e line 1, near "$_eq ".DS_Store"" Execution of -e aborted due to compilation errors."
Thanks again
Val
On 30 Mar 2010, at 00:39, Cosgrave Valentine wrote: Mark's last seems to have done the job.
do shell script "perl -MFile::Find -le 'find(sub { return if -d || $_\neq \".DS_Store\"; $mtime = (lstat $_)[9]; $newest =\n[$File::Find::name, $mtime] if !$newest || $mtime > $newest->[1]; },\nshift); print $newest->[0]' " & (quoted form of POSIX path of myFolder)
Thrilled.
Much appreciated.
Val
I had been preparing this email to spur a different approach
I came across a script in my search of the various threads.
set theList to (do shell script "/usr/bin/find " & quoted form of POSIX path of theFolder & " -type f ! -name '\\.*' -print0 | /usr/bin/xargs -0 /usr/bin/basename | /usr/bin/sort -df")
This returns the names of all the files (no folders) in the directory in paragraph format and in alphabetical order. and is very fast.
Might there be a way to sort these in date modified order ?
Please be aware that my level of scripting could be described as high level plagiarism.
Val
|
_______________________________________________
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