Jump to content

(faster) Menu Search


Recommended Posts

v1.6 - per app configuration

You can now specify custom configuration settings to fine tune menu listings for at an app level. Type ms into Alfred to get started.

Here's the settings.txt config I use:

# always show disabled menu items
appFilters {
  app: "BibDesk"
  showDisabledMenuItems: true
}

# for Safari, ignore the History and Bookmarks
# menus since loading it take a lot of time
appFilters {
    app: "Safari"
    ignoreMenuPaths {
        path: "History"
    }
    ignoreMenuPaths {
        path: "Bookmarks"
    }
}

# For Finder alone, show the Apple menu entries,
# and ignore any recent entries listed in the 
# Apple > Recent Items menu
appFilters {
    app: "Finder"
    showAppleMenu: true
    ignoreMenuPaths {
        path: "Apple"
        path: "Recent Items"
    }
}

 

Link to comment
  • 4 months later...

Hi @Benzi

 

I also did a new version of ctwise's Menu Bar Search, but in plain ObjectiveC. I didn't know about your swift version. :(

I'm using Alfred's Script Filter to do the filtering and I was wondering if I could use your swift code to do the menu scrapping and generate the output in Alfred's Script Filter JSON Format.

I went to look for the menu.swift on github but it looks like it's no longer available. Is there any other repo where I can get the code?

 

Cheers.

Alejandro.

 

Link to comment
  • 6 months later...

This is an amazing workflow. Saves me tons of clicks. Thank you!

 

I've discovered 2 bugs:

 

1. "Rename" opens "Item Info". If multiple files are selected, then instead of the "Rename x Items..." panel, the "Multiple Item Info" panel opens.

2. "Get Info" doesn't work, neither for a single item nor for multiple.

 

Thanks!

Edited by kodiak
Link to comment

Thanks! absolutely love this workflow, the only disavantage is a bit slower loading time for the menu items. Is there a way to speed it up using cache?  I'm new to the alfred and I was only able to edit the environment variables not the caches settings

Link to comment
  • 1 year later...
  • 3 weeks later...

Unfortunately this stopped working after I upgraded to Catalina.  :-(    I get the error "menu can't be opened because apple cannot check it for malicious software."  Then if I go to System Prefs | Security & Privacy | General and click "Allow Anyway", the same exact thing happens the next time I try to access it.  Any thoughts?

Link to comment
  • 1 month later...
  • 1 month later...
  • 2 months later...

@Benzi, this is super helpful. Especially for us Alfred fans. I would think that a lot of people would want this one feature. Do you think your code could be expanded to do just this one feature that could be a stand-alone product? Would love to work with you on that. @Benzi

Edited by dbw
tagging Benzi
Link to comment
  • 1 month later...
  • 1 year later...

FWIW I think this is something that the Alfred team should consider adding as a first party feature. It would be great to see menu items for the current app indexed/shown in the top level search results without the need for a modifier.

 

Obviously Paletro already does this, but there are many other clipboard managers too, not to mention apps for searching the filesystem.

Link to comment
2 hours ago, lewis42 said:

It would be great to see menu items for the current app indexed/shown in the top level search results without the need for a modifier.

 

It’s not uncommon for people to want their favourite Workflow to show up in the default results. What the request tends to not take into account is how that would affect everyone else’s usage and Alfred’s performance. The choice of what shows up in the default results is very deliberate. It’s a set of predictable results which can always be retrieved fast.


It doesn’t matter if it’s a Workflow or an integrated feature, this feature depends on the open app and throws a bunch of results. It’s not predictable and would overwhelm the other entries, which most people wouldn’t want. Making it an optional feature wouldn’t work either, because by now Alfred would have dozens of toggles for each of those, all competing with each other.


If you want this Workflow as your default results:

  1. Remove your Alfred hotkey.
  2. Make a new empty Workflow.
  3. Add a Hotkey Trigger. Set it to what was your Alfred hotkey.
  4. Connect that to a Run Script Action, with Language /usr/bin/osascript (AppleScript). In the Script box write:

tell application id "com.runningwithcrayons.Alfred" to search "KEYWORD_HERE"
tell application "System Events" to keystroke "a" using {command down}

 

Replace KEYWORD_HERE with whatever keyword you want, and you’re set. Whenever you press your Hotkey, you’ll get this Workflow running and the text will be auto-selected so you can just type to search something else. If you don’t want the text to be selected, remove the second line from the Script.

Link to comment
  • 4 months later...
On 4/18/2017 at 11:15 AM, Benzi said:

 

 

I have re-implemented ctwise's excellent implementation of the Menu Search workflow in Swift.

 

This version is ever so slightly faster (at least on my machine :)) - YMMV.

 

Requires OSX 10.7+

 

Download

 

This workflow is fantastic and one of my favourite. No need to remember lot of keyboard shortcuts. On Skim pdf application, it takes long time and gives error message "Could not get menu bar An error occurred -25204". It works well for all other applications except this one. Has anyone else experienced it? 

 

Link to comment
22 hours ago, pankajsz said:

This workflow is fantastic and one of my favourite. No need to remember lot of keyboard shortcuts. On Skim pdf application, it takes long time and gives error message "Could not get menu bar An error occurred -25204". It works well for all other applications except this one. Has anyone else experienced it? 

 

I found the reason for long time with Skim application. I had added 100s of pdf files via session bookmarks (using applescript) -- I removed and now it is faster. If there is a way to build menu periodically instead of every time, it will become more faster and can handle larger number of menu items.

Link to comment
  • 2 months later...
On 1/30/2020 at 9:00 PM, Benzi said:

Its a workaround - but try this on Catalina: https://github.com/BenziAhamed/Menu-Bar-Search/issues/4

 

For Microsoft products such as word and excel, there are a lot of actions in ribbon (example page layout - width). These are not in topmost menu bar hence not available via this workflow. Is it possible that the items on the ribbon can be activated via keyboard search? Is there another workflow that can achieve this?

 

image.thumb.jpeg.fb68499b33bc8ece99bf8795deb4217f.jpeg

Link to comment
3 hours ago, vitor said:

 

That depends entirely on the apps themselves. I find it unlikely the Office apps will make those programatically available.

thanks Vitor. More clarifications on the request:

 

1. Ribbon item

It will be great if widely used Office apps Microsoft Excel or word can be investigated for this. There are lot of items that are on the ribbon but not on menu.

 

2. VBA macro

Also, I can run AppleScript code specific to MS excel directly using net.deanishe.alfred-appscripts. But to run vba macros stored in Personal.xlsb, I have to:

1. Tool - macros (I use menu bar search for this)

2. In macro dialog box, I have to go to end of xlsb! and type the name of sub routine (have to type exactly -- this is time consuming step)

3. click on run to execute

 

Is there a better way of doing it via Alfred?

 

image.thumb.jpeg.aeb9e42214b1116496e21f6eb26ce099.jpeg

 

2a. The alternative is to use AppleScript more. But AppleScript dictionary for MS Excel is not very documented. To get print area to be set up for active sheet (code below), I had to search, try to make it work.

 

tell application "Microsoft Excel"

set tid to AppleScript's text item delimiters

set myRange to ""

set wb to active workbook

 

set ctr to active sheet of active workbook

set sname to the name of ctr

set lastrow to count of rows of used range of ctr

set lastcol to count of columns of used range of ctr

if lastrow is greater than 40 then

set lastrow to 40

end if

 

set AppleScript's text item delimiters to {":"}

set columnLetters to text item 1 of (get address of (column lastcol) of worksheet ctr without column absolute)

set name of (get resize range "A1" of worksheet ctr row size lastrow column size lastcol) to "Print_Area"

save

 

set AppleScript's text item delimiters to tid

 

end tell

 

2b. Run vba macro from AppleScript such as below -- is this feasible or recommended?

tell application "Microsoft Word"

run VB macro macro name "page_number"

end tell

 

Thanks in advance for your help and guidance. Let me know if there is a better location to post these type of queries.

Link to comment

I’m not intimately familiar with the Office apps but the query isn’t particularly related to Alfred. If there’s a way to do it, one will have to write some code for it, AppleScript or otherwise. The Office or Microsoft forums might be a good place to ask, or an AppleScript-specific forum, or Ask Different. Once you have the code to do it—assuming Office supports it—integrating into Alfred should be the simple part.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...