Re: Shane's BridgePlus LIbrary
Re: Shane's BridgePlus LIbrary
- Subject: Re: Shane's BridgePlus LIbrary
- From: Shane Stanley <email@hidden>
- Date: Wed, 01 Jun 2016 11:04:08 +1000
On 1 Jun 2016, at 10:13 AM, Jim Underwood <email@hidden> wrote:
use scripting additions use framework "Foundation" use script "BridgePlus" load framework
set folderToSearch to (choose folder) as alias set mdQueryStr to "kMDItemTextContent CONTAINS 'gopro'" set mdQueryValues to (current date) - 10 * days
set fileList to my spotSearch(folderToSearch, mdQueryStr, mdQueryValues)
on spotSearch(pFolderToSearchAlias, pQueryStr, pQueryValues)
set theResult to current application's SMSForder's runSpotlightQuery:pQueryStr queryValues:{pQueryValues} inFolders:{pFolderToSearchAlias} |error|:(missing value)
ASify from theResult
--- RETURN as POSIX File List --- return theResult as list
end spotSearch
Actually, you only need to use queryValues when you're searching for something other than text, like a date. Because you have a complete search predicate string, you can simplify a bit:
use scripting additions use framework "Foundation" use script "BridgePlus" load framework
set folderToSearch to (choose folder) as alias set mdQueryStr to "kMDItemTextContent CONTAINS 'gopro'" set fileList to my spotSearch(folderToSearch, mdQueryStr)
on spotSearch(pFolderToSearchAlias, pQueryStr) set theResult to current application's SMSForder's runSpotlightQuery:pQueryStr inFolders:{pFolderToSearchAlias} |error|:(missing value) ASify from theResult --- RETURN as POSIX File List --- return theResult as list end spotSearch
|
_______________________________________________
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