Clicky

Houdah Software Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
lbernstein

Registered:
Posts: 3
 #1 
I've been using an Alfred workflow calling the AppleScript:

tell application id "com.houdah.HoudahSpot4"
    search "{query}"
    activate
end tell

My results are too general, and I'd like to have the search term entered into the first field under the "Refine" section after: Name...contains... XXX.

Can someone help me update the script?

Thanks,

Larry 

0
houdah

Moderator
Registered:
Posts: 2,966
 #2 
Hi Larry,

Try the following script:

tell application id "com.houdah.HoudahSpot4"
        search "search:name {query}"
        activate
end tell
 
When you enter "Apple Tree" as query through Alfred, HoudahSpot will search for files whose names have both the word prefixes "Apple" and "Tree". This will find a file named "Treecutter Applejuice".


Add quotes if you want HoudahSpot to treat the query as single 
prefix:

tell application id "com.houdah.HoudahSpot4"
        search "search:name \"{query}\""
        activate
end tell
Now a search for "Tree" will find the "Treecutter Applejuice" file. A search for "Apple" will not.


Add asterisk wildcards to search for names that contain the query:

tell application id "com.houdah.HoudahSpot4"
        search "search:name \"*{query}*\""
        activate
end tell

Now searches for "Apple", "Tree", or "Cutter" will all find the "Treecutter Applejuice" file.


The big advantage of the first script is that it leaves all option open. Type Apple Tree without the quotes in Alfred to search by both word prefixes. Type "Apple Tree" with the quotes to search for the combined prefix. Type asterisk wildcards where you need them.


Best,
Pierre Bernard

__________________
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
lbernstein

Registered:
Posts: 3
 #3 
Is there a way of calling the Apple Mail Messages template through AppleScript?

Thanks,

Larry
0
houdah

Moderator
Registered:
Posts: 2,966
 #4 

tell applicationid "com.houdah.HoudahSpot4"

set homeFolderPath to POSIX path of (path tohome folder)

set templatePath to homeFolderPath & "Library/Application Support/com.houdah.HoudahSpot4/Templates/Sample Templates/Apple Mail Messages.hstemplate"

search "search:name {query}" templatetemplatePath

activate

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
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.