Re: Filtering by author and file
Re: Filtering by author and file
- Subject: Re: Filtering by author and file
- From: Philip Aker <email@hidden>
- Date: Wed, 22 Aug 2007 15:50:26 -0700
On 2007-08-21, at 17:54:34, Luther Fuller wrote: On Aug 21, 2007, at 7:46 PM, Michelle Steiner wrote: It does not work if the file's name contains a space.
Mmmmm. But this does ...
on open dropList tell application "Finder" repeat with dropItem in dropList if (class of item dropItem) is document file then do shell script "mdls " & (quoted form of POSIX path of dropItem) display dialog the result end if end repeat end tell end open
The following obtains files which have Spotlight author entries in a given directory. Unfortunately, the listing is hardly convenient for AppleScript users. Furthermore, mdls incorrectly errors to stdout :-(
set ppath to quoted form of (POSIX path of (path to desktop)) set dlist to {}
try set end of dlist to (do shell script "cd " & ppath & ";mdls -name kMDItemAuthors *.pdf") end try try set end of dlist to (do shell script "cd " & ppath & ";mdls -name kMDItemAuthors *.doc") end try try set end of dlist to (do shell script "cd " & ppath & ";mdls -name kMDItemAuthors *.rtf") end try dlist
Philip Aker |
_______________________________________________
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