Jump to content
ctwise

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: "?

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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": [
    ]
}

Share this post


Link to post
Guest nXqd

This is a brilliant idea, thanks :)

Share this post


Link to post

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?

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

The apple and services menu are explicitly excluded to speed up the results. So, yes, there is, and no, I don't have any current plans to change it.

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...