OK, here you go:
Search JXA Scripts-ver2.lbaction.zip (6.1 KB)
>>> Please read through the whole post to understand how it works.
â
The JXA-Search action now has two âpersonasâ:
####A. Search for a JXA script
This is exactly as with the old version: bring up the JXA-Search action, hit the Spacebar and enter your query.
B. Set search path
This is the new part.
-
Select any folder where you want to limit your search to, e.g. âScriptsâ
-
Send the âScriptsâ folder to the Action, as you know it from other Send actions:
-
While the âScriptsâ folder is selected hit the Send key (Tab)
-
Type your abbreviation to bring up the JXA-Search action
-
Once the JXA-Search action is selected hit the Return key (not the Spacebar!)
Now the âScriptsâ folder is the new search path.
â
Now, to actually perform a search in the âScriptsâ folder, bring up the JXA-Search action again and hit the Spacebar to enter your query. (Like in step A.)
You may have noticed that, to fully enjoy the action, you must make use of the Spacebar and of the Return key. If your problem with the Return key still persists, then this might be an issue!
To understand what the Return key does and what the Spacebar does, please open the script (default.scpt). You find two explanatory comments there.
Unfortunately I havenât found a way to do the two things in one step.
But you know the âB hotkey, donât you? âB brings up the recently performed actions and items (a very useful hotkey!).
That means in our case: after you have set a new search folder, just hit âB and the JXA-Search action will instantly be selected again and you can enter your query by hitting the Spacebar.
Default search path:
The default search path is set to $HOME. You can change the path in the script: just replace all instances of ${HOME}
with the POSIX path of your preferred default search path.
Quickly reset a custom search path to the default path:
To restore your default search path it is not necessary to send the default folder to the action.
Just type /d
into the query field.
You donât even have to close/re-open the action, just wait a second for the live search to kick in, and the path will be reset to the default! (Youâll see a message when it happened.)
As soon as you see the message you can type a new search string to search in your default path.
â
Have fun!
⌠and remember, âB is your friend!