Split from the other topic… I think this is important enough to be put in its own topic.
It seems that Nimble Commander is unable to search for XAs like kMDItemUserTags with Spotlight, i.e. searching for "foo" works, but not "tag:foo". Any plans to implement expanded Spotlight search incl. tag/XA search functionality in NC?
Spotlight search in NC #2: tags, XAs etc.
Re: Spotlight search in NC #2: tags, XAs etc.
You can customise a query string via config: "filePanel.spotlight.format".
Config.json contains some explanation.
I have no plans to improve Spotlight support at the moment.
Config.json contains some explanation.
I have no plans to improve Spotlight support at the moment.
Re: Spotlight search in NC #2: tags, XAs etc.
Hmm… there aren't any explanations in the config.json. I assume I have to create something like this:
But I can't say how to modify foo to have an actual effect. (?)
Code: Select all
{
"filePanel": {
"spotlight": {
"format": "foo"
},
Re: Spotlight search in NC #2: tags, XAs etc.
It's in the "original" version of Config.json:
Code: Select all
migun@Michaels-MBP-13-2020 Resources % cat /Applications/Nimble\ Commander.app/Contents/Resources/Config.json | grep -A 12 spotlight
"spotlight": {
/**
* Search request formatting. #{query} will be replaced with entered search criteria.
* There's an option to split input parameter string into substrings with spaces(" ") and use them separately.
* To do so #{query1}, #{query2}, ..., #{query9} should be used, like the one below:
* "kMDItemFSName == '*#{query1}*'cd && kMDItemFSName == '*#{query2}*'cd && kMDItemFSName == '*#{query3}*'cd && kMDItemFSName == '*#{query4}*'cd && kMDItemFSName == '*#{query5}*'cd && kMDItemFSName == '*#{query6}*'cd && kMDItemFSName == '*#{query7}*'cd && kMDItemFSName == '*#{query8}*'cd && kMDItemFSName == '*#{query9}*'cd".
*/
"format": "kMDItemFSName == '*#{query}*'cd",
/**
* Maximum results count to fetch.
*/
"maxCount": 1024
Re: Spotlight search in NC #2: tags, XAs etc.
Ah, thank you. So you can't input the kMDItem keys directly into NC's search field, which means you would have to load a different config every time you want to do an alternate search, right? E.g. like so… with the mv command substituting the main config for a prepared config that contains the search terminology for tags, i.e.
Code: Select all
"format": "kMDItemUserTags == '*#{query}*'cd"
Code: Select all
#!/bin/zsh
# ncspot
! [[ $* ]] && exit 1
searchtag=false
if [[ $1 == "--tag" ]] ; then
searchtag=true
shift
fi
searchterm="$*"
if ! $searchtag ; then
osascript -e "tell application \"Keyboard Maestro Engine\" to do script \"NCSpotlight\" with parameter \"$searchterm\""
else
supportdir="$HOME/Library/Application Support/Nimble Commander/Config"
mv "$supportdir/Config.json" "$supportdir/bak.Config.json"
mv "$supportdir/tags.Config.json" "$supportdir/Config.json"
sleep 1
osascript -e "tell application \"Keyboard Maestro Engine\" to do script \"NCSpotlight\" with parameter \"$searchterm\""
sleep 1
mv "$supportdir/Config.json" "$supportdir/tags.Config.json"
mv "$supportdir/bak.Config.json" "$supportdir/Config.json"
fi
exit