• 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: Shane's BridgePlus LIbrary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: Shane's BridgePlus LIbrary
      • From: Jim Underwood <email@hidden>
References: 
 >Re: Shane's BridgePlus LIbrary (From: Jim Underwood <email@hidden>)
 >Re: Shane's BridgePlus LIbrary (From: Christopher Stone <email@hidden>)
 >Re: Shane's BridgePlus LIbrary (From: Jim Underwood <email@hidden>)

  • Prev by Date: Re: Shane's BridgePlus LIbrary
  • Next by Date: Re: Shane's BridgePlus LIbrary
  • Previous by thread: Re: Shane's BridgePlus LIbrary
  • Next by thread: Re: Shane's BridgePlus LIbrary
  • Index(es):
    • Date
    • Thread