Houdah Software Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
rick260

Registered:
Posts: 18
 #1 
Is there a way to attach a script to houdahspot?
0
houdah

Moderator
Registered:
Posts: 2,906
 #2 
Hi!

I am not sure I understand the question.

You can use AppleScript to start a HoudahSpot search, wait till it has completed gathering results and then get these results for use in your script.

Example:

tell applicationid "com.houdah.HoudahSpot4"

set myLocations to {"/Applications"}

set myDocument to search "HoudahSpot" locationsmyLocations

 

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

set myPath to path of first item of mySelection

display dialogmyPath

end if

end tell

 


Best,

Pierre Bernard
Houdah Software s.à r.l.


__________________
Houdah Software s. à r. l.
https://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Advanced file search utility
Tembo: Easy and effective file search
0
rick260

Registered:
Posts: 18
 #3 
i am trying to get HoudahSpot to search lists of file names. 

its my understanding that when houdahspot encounters a list it defaults "and" (invisible boolean) after/between each

houdahspot will search lists of names if it is "or" and not "and"

some programs (Indesign etc etc) allow for "attached scripts" which take effect when the program is launched.

i was hoping that a script could be added/attached  to houdahspot that would tell it to switch "and" to "or" whenever it encountered a list.




0
houdah

Moderator
Registered:
Posts: 2,906
 #4 
Top level search criteria as well as search terms entered in the main search field must all be matched (implicit AND).

You can use the OR operator in the search field. Example:

search:filename 1952834 OR 1955420 OR 1958639

You can, of course, add groups (e.g. ANY of the following are true) to the search in the Refine pane. This however cannot be scripted.


Your best option is to create a search string like in the example above and pass it to HoudahSpot using Apple Script.

tell application id "com.houdah.HoudahSpot4"

search "search:filename 1952834 OR 1955420 OR 1958639"

end tell

 


__________________
Houdah Software s. à r. l.
https://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Advanced file search utility
Tembo: Easy and effective file search
0
rick260

Registered:
Posts: 18
 #5 
i am using text captured from a Acrobat PDF file.

here is a UI script (see below) that will add "or" but the user has to run the script after copying the text...which is sort of clumsy. i was hoping for higher degree of automation

can you think of another way to get the selected text to have an "or" after each entry when it it pasted into the houdahspot search field

...........

tell application "System Events" to tell process "AdobeAcrobat" # check the name of the process

set frontmost to true

keystroke "c" using {command down}

end tell

delay 0.1

set searchNumbers to paragraphs of (the clipboardas «class utf8») # EDITED

set oTIDs to AppleScript'stext item delimiters

set AppleScript'stext item delimiters to " or "

set searchtext to searchNumbers as text# EDITED, the enclosing parenthesis were unwanted

set AppleScript'stext item delimiters to oTIDs

 

tell application "HoudahSpot"

activate

searchsearchtext

end tell

0
houdah

Moderator
Registered:
Posts: 2,906
 #6 
You can use the Automator application to create a service to run the script.

A service can be invoked from the Services submenu in the context menu or application menu.

I.e. the user then just needs to select the text, right-click and select the service from the menu. This runs your script and brings up search results in HoudahSpot.

__________________
Houdah Software s. à r. l.
https://www.houdah.com

HoudahGeo: One-stop photo geocoding
HoudahSpot: Advanced file search utility
Tembo: Easy and effective file search
0
rick260

Registered:
Posts: 18
 #7 
i will have to look into that. i have never used automator.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.