• 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: Jim Underwood <email@hidden>
  • Date: Wed, 01 Jun 2016 00:13:07 +0000
  • Thread-topic: Shane's BridgePlus LIbrary

Thanks, Chris.

I got this example working:


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




One challenge is finding the Spotlight/mdfind attribute names to use.
Here's one source:  Spotlight syntax, mdfind examples, and metadata attributes 


kMDItemPath: absolute path.

kMDItemFSName: basename.

kMDItemFSSize: size in bytes.

kMDItemDisplayName: display name.

kMDItemContentType: UTI.

kMDItemContentTypeTree: UTI and parent UTIs.

kMDItemKind: a localized name for the content type.

kMDItemFSContentChangeDate: modification time.

kMDItemFSCreationDate: creation time.

kMDItemLastUsedDate: date last opened.

kMDItemDateAdded: date added.

kMDItemFinderComment: Spotlight comment.

kMDItemTextContent: plain text content of for example text, HTML, or PDF files.

kMDItemDurationSeconds: for example the duration of an audio or video file.

kMDItemTitle: for example the title of a webloc, PDF, or MP3 file.

kMDItemURL: for example the URL of a webloc file.

kMDItemWhereFroms: the URL or URLs that a file was downloaded from.

kMDItemUserTags: tags in 10.9 and later.

kMDItemAuthors: for example the artist of an MP3 file.


mdfind 'kMDItemTextContent="*expose*"cd' # search for files whose content matches `expose` ignoring case and diacritics

mdfind 'kMDItemTextContent="*search phrase*"c' -onlyin ~/Library/Caches/Metadata/Safari/History





Best Regards,

Jim Underwood
aka JMichaelTX


From: <applescript-users-bounces+jmichael=email@hidden> on behalf of Chris Stone <email@hidden>
Date: Tue, May 31, 2016 at 6:35 PM
To: "ASUL (AppleScript)" <email@hidden>
Subject: Re: Shane's BridgePlus LIbrary

On May 31, 2016, at 18:00, Jim Underwood <email@hidden> wrote:
I can't seem to find any documentation on how to use this handler:
runSpotlightQuery:queryValues:inFolders:error:
______________________________________________________________________

Hey Jim,

https://www.macosxautomation.com/applescript/apps/BridgePlus.html

The SMSForder methods are documented here. This is a work in progress.

https://www.macosxautomation.com/applescript/apps/BridgePlus_Manual/Pages/runSpotlightQuery_inFolders_error_.html

--
Take Care,
Chris

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