FoxTrot Search Forum
FoxTrot Search for macOS Forum

Home » Public Forums » FoxTrot Search User Forum » Help Needed with Foxtrot Applescript
Re: Help Needed with Foxtrot Applescript [message #1110 is a reply to message #1104] Wed, 16 December 2020 15:52 Go to previous messageGo to previous message
FoxTrot Engineering
Messages: 385
Registered: April 2020
Senior Member
Regular expressions are usually used through the criterion [then apply advanced filter] [contents] [contains the regular expression], which can only be used as a secondary criterion. Using AppleScript, you can currently only specify the search string for the first criterion, so you can't use regex filters from AppleScript.

However, you can also use regular expressions through the FoxTrot Query syntax, enclosing the regex between acute accents. Here again, you can't only specify a regular expression, there should be some other search words. For example, you could search for: [contents] [matches the foxtrot query] [secret memo `\b\d\d/01/\d\d(\d\d)?\b`] to search for documents containing the words [secret] and [memo] and the regex \b\d\d/01/\d\d(\d\d)?\b (which matches a date in the format mm/dd/yyyy or mm/dd/yy where dd is 01).

To execute this search from AppleScript (note that backslashes should be escaped in AppleScript):

tell application "FoxTrot Professional Search"
search "secret memo `\\b\\d\\d/01/\\d\\d(\\d\\d)?\\b`"
end tell


Jérôme - FoxTrot Engineering
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Issues in PowerMail
Next Topic: Search for PDFs with highlights
Goto Forum:
  


Current Time: Wed May 15 02:27:04 GMT+2 2024