Both this forum and the HoudahSpot manual contain examples of how to search with HoudahSpot via Applescript:
From the manual:
tell application id "com.houdah.HoudahSpot4"
set myLocations to {"/Users/hl/Dropbox/CT/Jobs"}
set myDocument to search "Rechnungsdaten" locations myLocations
repeat until search completed of myDocument
end repeat
set myResults to results of myDocument
set myCount to count of myResults
display dialog "Found " & myCount & " files"
set mySelection to selection of myDocument
if mySelection is not {} then
end if
end tell
I am trying to create a macro to search a subfolder of the Documents folder (e.g. ~/Documents/PDF) for (1) all PDF files with (2) the string _de-DE in their names for a certain word (stored in a variable). Once all found files are listed in HoudahSpot, I open one of them manually in Skim (or as a second choice in Preview) by clicking in the Results list. I then want to (3) see the first occurrence of the searched word in Skim (Preview).
The reason why I want to use Skim is that this PDF viewer is more scriptable (not that I have the knowledge): I want to (4) get the page number of the first occurrence of the searched word and open another (related) PDF and (5) navigate to the same page number.
Can anyone tell me:
(1) How to limit the search via AppleScript to PDF files only?
(2) How to limit the search to all (PDF) files that contain the language code _de-DE in their names?
(3) How to navigate to the first occurrence of the searched string when opening a PDF from HoudahSpots Results list.
(4) How to get the page number of the PDF opened in Skim.
(5) How to navigate to a page number in Skim.
(6) I can instruct macOS to always open all PDF files in Skim, but that's a bit drastic. (I like to keep Preview as the default app for many PDF files.). Is there another way to use Skim when opening results in HoudahSpot?
Thanks for any help!
Edit: I've found that items (1) and (2) can be solved by setting the file type, folder and language code and saving the settings as the default settings: