Clicky

Nevada_Princess
Hi All,

Most frequently I use HoudahSpot to search the current folder, and use this with Path Finder via the installed service, but it's a bit awkward.

So I'm trying to replicate the toolbar search function in Finder using Path Finder, but no luck so far. I've successfully assigned a keyboard shortcut to search the current Path Finder location in HoudahSpot service, but for the life of me I cannot find where that service is stored. I would like to turn it into a small app that I can create a toolbar icon for, similar to the one available in Finder.

After a great deal of digging, I finally located the AppleScript inside the HoudahSpot application that provides this in Finder, and have been unsuccessful at adapting it to Path Finder. The lines of the script are here:

on run
    tell application "HoudahSpot"
        finderSearch
        activate
    end tell
end run

-- script was drag-and-dropped onto
on open (theList)
    set folderList to {}
    tell application "Finder"
        repeat with myItem in theList
            if ((class of myItem) is folder) then
                set end of folderList to myItem
            else
                set myFolder to container of myItem as alias
                set end of folderList to myFolder
            end if
        end repeat
    end tell
    tell application "HoudahSpot"
        open folderList
        activate
    end tell
end open

If I replace the application "Finder" with "Path Finder" it still will open the current Finder folder, not Path Finder. I suspect it has something to do with the "finderSearch" line, but I can find no further reference to that.

Any of you scripting wizards out there have any ideas?

Thanks very much!
0 0
houdah
Hi!

finderSearch is a feature of HoudahSpot. It is hard-coded to check for Finder windows.

The bottom part of the script handles drag and drop.

If you can figure out which folder is currently open in PathFinder, you could "open" that in HoudahSpot.

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 0
Nevada_Princess
Thank you, Pierre.

Okay, that explains "findersearch" and why I could find no reference to it.
Is this something that could be provided externally as a script for Path Finder? Seems like what needs to be done is to pass the current Path Finder folder to HoudahSpot and the rest of the search script would work just as it does for Finder.

The other thing is the service that's already available in Path Finder that does exactly this, labeled "Search Location in HoudahSpot." How is that service implemented? I've searched high and low in the System, Library and Home Library folders for where it is saved with no success. Works great with a defined keyboard shortcut, but there must be a simple way to turn it into a mini-app that could be added to the Path Finder toolbar.

I see this has come up here on the forum a couple of times in the past. Perhaps you could consider building this into HoudahSpot directly?

Thanks!
0 0
houdah
Hi!

In pseudo-script you need to do something like this

set folderPath to "/"
tell application "PathFinder
    set folderPath to path of frontmost window
end tell
tell application "HoudahSpot"
    open folderPath
end tell

Unfortunately, I am not good at AppleScript and don't know PathFinder's AppleScript capabilities.
You might be able to find a relevant script or ask CocoaTech.

Services are most often implemented by applications. They are declared in an application's Info.plist file.
Right-click the HoudahSpot.app icon in the Finder. Show Package Contents. Navigate to Contents/Info.plist.

HoudahSpot declares 3 services: newSearch, blitzSearch and locationSearch

Navigate to Contents/Resources. Right-click HoudahSpotHelper.app icon in the Finder. Show Package Contents. Navigate to Contents/Info.plist

HoudahSpotHelper declares 2 more services: prepareBlitzSearch and tagFiles

Normally, you should not need to worry about these details.
Services are listed with a more descriptive name in System Preferences > Keyboard.

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 0
Nevada_Princess
Hmm, okay, this will take a bit of work. But thank you for these tips. I'm quite novice at AppleScript, so will just have experiment. That also explains more about the mysterious services...I thought those were always saved as separate .workflow files and never thought to look into .plist files. Its surprising how complex creating a toolbar app seems to be compared to simply defining a keyboard shortcut to use the existing service! I was thinking I would find the service and simply turn it into an app and assign it to the toolbar. But whew!

Thanks again!
0 0
houdah
This might actually work:

tell application "HoudahSpot"

tell application "Path Finder"

if ((count of Finder windows) > 0) then

set currentPath to (target of Finder window 1 as alias)

end if

end tell

 

opencurrentPath

end tell


I can't test it since Path Finder currently refuses to run on my Mac.

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 0
Nevada_Princess
Hi Pierre,

Thanks for that. Doesn't seem to work as it is, though. Is this meant to be stand-alone, or appended to the script that HoudahSpot uses for Finder?

Running by itself, it does seem to be seeing the current Path Finder folder, but something's not correctly formatted...something about not being able to create an alias. I'm rather flying blind here as I have no experience with Apple Script. Here are the results when it runs:

tell application "Path Finder"
    count every finder window of current application
        --> 1
    get target of finder window 1
        --> fsFolder "Documents" of fsFolder "Snoopy" of fsFolder "Users" of disk "Scooter"
    get fsFolder "Documents" of fsFolder "Snoopy" of fsFolder "Users" of disk "Scooter"
        --> fsFolder "Documents" of fsFolder "Snoopy" of fsFolder "Users" of disk "Scooter"
Result:
error "Can’t make «class cfoL» \"Documents\" of «class cfoL» \"princess\" of «class cfoL» \"Users\" of «class cdiS» \"Scooter\" of application \"Path Finder\" into type alias." number -1700 from «class cfoL» "Documents" of «class cfoL» "Snoopy" of «class cfoL» "Users" of «class cdiS» "Scooter" to alias

Thanks!
0 0
houdah
Hi!

It was meant to go into to "on run" block of the original script.

It should also be able to run as is in Script Editor.
It does work if I replace "Path Finder" with "Finder"

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 0
Nevada_Princess
--> It was meant to go into to "on run" block of the original script.

Okay, that's what I was thinking, but it wasn't working in either case.

Nevertheless, I doesn't seem to work when I tried changing it to just "Finder" either. The variable "currentpath" seems to be an issue, and it sends back this error:

error "The variable currentPath is not defined." number -2753 from "currentPath"

Maybe I need to send this over to the CocoaTech forums and see if anyone knows?
0 0
houdah
Hi!

currentPath is defined only if Finder has at lease 1 window. It should if there is a button.

The CocoaTech forums should be the best place for questions about scripting Path Finder.

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 0
Nevada_Princess
Okay, yes, it does run if I have a Finder window open.
Guess I'll send this over to CocoaTech and see if any help there. I definitely need to drop this down on my priority list to a side project...lot of work for a tiny bit of convenience!
Thanks for all the help!

And by the way, I LOVE HoudahSpot! This has helped me SO MUCH in finding files. So much better than Spotlight!
0 0
rocklobster
This thread is old, but piping in here to say I use Path Finder and this should be easy enough. (Major difference with PF is you typically need to use POSIX paths…) But before I take a stab (if I get a chance), did you figure this out?  If so, please post a working script.
0 0
houdah
Hi!

A script is available from this Tips & Tricks blog post:
http://blog.houdah.com/2015/03/search-current-finder-folder/

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 0
rocklobster
Thanks. Seems to be a bug in the way it opens HS tho.  It opens with the search pane closed (intentional?). Reveal search pane and the "Refine" and "Locations" section are blank.  Toggle closed/open and then it's as it should be.
0 0
houdah
Hi!

The search pane should be shown or hidden depening on how you last left it in HoudahSpot. I.e. if you hide it and then open a new window, it will also be hidden in the new window.

You may have a damaged default template. Please go to HoudahSpot > Preferences > General and select "Factory Default". Then try again.

Please also check /Applications/Utilities/Console.app > All Messages for error messages.

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 0
JG
neat - cleaned up templates & downloaded script - all worked well - thanks
0 0