Jump to content

Menu Search


Recommended Posts

I haven't looked in to it much, but would it be possible to add checkmarks to the menu items? I see it's commented out in the code (kAXMenuItemMarkCharAttribute), just wondering if it's something that might be added in the future.

 

Also, it was a bit confusing when I tried to action a menu item that was disabled. I had to check the menu bar to figure out why it wasn't working. Should they just be excluded from the results, or maybe prefixed with "Disabled: "?

Link to comment

I haven't looked in to it much, but would it be possible to add checkmarks to the menu items? I see it's commented out in the code (kAXMenuItemMarkCharAttribute), just wondering if it's something that might be added in the future.

 

Also, it was a bit confusing when I tried to action a menu item that was disabled. I had to check the menu bar to figure out why it wasn't working. Should they just be excluded from the results, or maybe prefixed with "Disabled: "?

 

You can't trust disabled. Alfred takes focus so most apps disable all menu entries that rely on focus or selection.

Link to comment

Thanks for the quick reply.

 

menudump outputs a json with "menu" being an empty array, so I guess it's the ruby script.

{
  "name": "Terminal"
  "bundleIdentifier": "com.apple.Terminal"
  "bundlePath": "/Applications/Utilities/Terminal.app"
  "executablePath": "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal"
  "menus": [
    ]
}
[Process completed]

 

 

The output of the ruby script is

./menu_items.rb:10:in `gather_leaves': undefined method `each' for nil:NilClass (NoMethodError)
	from ./menu_items.rb:28:in `generate_items'
	from main.rb:7

 

my ruby version is 1.8.7, it's the system ruby.

 

Please download this version of menudump - http://tedwi.se/u/dw

 

Run it with './menudump --debug --debug' and respond with the results.

Link to comment

I haven't looked in to it much, but would it be possible to add checkmarks to the menu items? I see it's commented out in the code (kAXMenuItemMarkCharAttribute), just wondering if it's something that might be added in the future.

 

Also, it was a bit confusing when I tried to action a menu item that was disabled. I had to check the menu bar to figure out why it wasn't working. Should they just be excluded from the results, or maybe prefixed with "Disabled: "?

 

The checkmarks aren't returned reliably. I haven't seen any false positives but they definitely aren't returned in all cases, for example, in Sublime Text 2, the language and theme are checked correctly but word wrap is not and neither is save all on build. The same is true for key shortcuts. It must be possible to do it correctly, there are utilities that do it, but I don't know how to do it reliably.

Link to comment

Please download this version of menudump - http://tedwi.se/u/dw

 

Run it with './menudump --debug --debug' and respond with the results.

 

Here is the result, the strange question marks are not a paste error, my terminal also displays them like this.

./menudump: line 1: bplist00?_WebMainResource: command not found
./menudump: line 2: syntax error near unexpected token `<'
./menudump: line 2: `

                     _WebResourceData_WebResourceMIMEType_ebResourceTextEncodingName_WebResourceFrameName^WebResourceURLOb<html><head><style type="text/css"></style></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Ïúíþ€ … H__PAGEZEROh__TEXT
Link to comment

Here is the result, the strange question marks are not a paste error, my terminal also displays them like this.

./menudump: line 1: bplist00?_WebMainResource: command not found
./menudump: line 2: syntax error near unexpected token `<'
./menudump: line 2: `

                     _WebResourceData_WebResourceMIMEType_ebResourceTextEncodingName_WebResourceFrameName^WebResourceURLOb<html><head><style type="text/css"></style></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Ïúíþ€ … H__PAGEZEROh__TEXT

 

Well that didn't work. :-) The download was corrupt.

 

Enter this: curl http://tedwise.com/files/menudump > menudump

Then chmod +x menudump

Then ./menudump --debug --debug

Link to comment

Well that didn't work. :-) The download was corrupt.

 

Enter this: curl http://tedwise.com/files/menudump > menudump

Then chmod +x menudump

Then ./menudump --debug --debug

 

My bad, here is the new result:

 

2013-04-17 11:09:05.555 menudump[26662:707] DEBUG NSArray *menuItemsForElement(NSString *, AXUIElementRef, NSInteger, NSInteger, NSDictionary *):107 - Looking at menu at depth 0
2013-04-17 11:09:05.557 menudump[26662:707] DEBUG                 -[uIAccess convertMenuToJSON:app:]:349 - Converting menu to JSON
{
  "name": "Terminal"
  "bundleIdentifier": "com.apple.Terminal"
  "bundlePath": "/Applications/Utilities/Terminal.app"
  "executablePath": "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal"
  "menus": [
    ]
}
Link to comment

Do you have this checked in Settings?

 

YOU ARE MY HERO. Yep, checking this option fixes the problem.

 

I did a clean install of 10.8.3 just a few days back. Since most people don't have this issue, I guess this option was checked by default in earlier versions and turned off later on?

Link to comment

YOU ARE MY HERO. Yep, checking this option fixes the problem.

 

I did a clean install of 10.8.3 just a few days back. Since most people don't have this issue, I guess this option was checked by default in earlier versions and turned off later on?

 

No, it's not checked by default. I'm guessing most of the people who buy Alfred muck around with AppleScripts and Automator flows that require it be checked. You probably did what the rest of us do, forget you checked a settings box when you reinstall or buy a new machine. :-)

Link to comment

No, it's not checked by default. I'm guessing most of the people who buy Alfred muck around with AppleScripts and Automator flows that require it be checked. You probably did what the rest of us do, forget you checked a settings box when you reinstall or buy a new machine. :-)

 

Thanks for the help and thank you for the great workflow. :)

Link to comment

I have the feeling this is likely not possible, but is it possible to use this without it calling Finder? If you’re using an alternative like Path Finder, which allows you to have Finder closed, when you pick an option it’ll open Finder, to be able to select it.

 

There's nothing in the workflow that calls or references Finder.

Link to comment

There's nothing in the workflow that calls or references Finder.

 

Looking through it that was my impression (hence thinking it would probably not be possible). I’ll just let Finder open, then. I’ll post back if I find an alternative.

Edited by Vítor
Link to comment
  • 2 weeks later...
  • 3 weeks later...

Whoa, how did I manage to miss this?! Very well done, dear, I'm duly impressed! Would love to get a look at the Objective-C, if you've a mind to stick it on Github.

 

Also, I'm gonna be a feature freak and ask: Since it looks like the workflow collects shortcut keys, is there any way to show them in its feedback? It'd be a boon for memorizing more esoteric Sublime key-combos.

Link to comment

Whoa, how did I manage to miss this?! Very well done, dear, I'm duly impressed! Would love to get a look at the Objective-C, if you've a mind to stick it on Github.

 

Also, I'm gonna be a feature freak and ask: Since it looks like the workflow collects shortcut keys, is there any way to show them in its feedback? It'd be a boon for memorizing more esoteric Sublime key-combos.

 

It's already on Github. The shortcut keys can't be reliably extracted, hence the lack of display. The applications that display shortcut keys for applications exhibit similar problems, which is why at least one of them let you download custom shortcut lists. I believe the shortcut extraction can be improved slightly based on the results from the proprietary apps but I'm not sure how they're doing it.

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...