ClintonStrong Posted April 16, 2013 Share Posted April 16, 2013 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
ctwise Posted April 16, 2013 Author Share Posted April 16, 2013 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
ctwise Posted April 16, 2013 Author Share Posted April 16, 2013 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
ctwise Posted April 16, 2013 Author Share Posted April 16, 2013 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
hgl Posted April 17, 2013 Share Posted April 17, 2013 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
ctwise Posted April 17, 2013 Author Share Posted April 17, 2013 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
hgl Posted April 17, 2013 Share Posted April 17, 2013 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
hgl Posted April 17, 2013 Share Posted April 17, 2013 Do you need me to get on IRC or something so I can send you results more efficiently? Link to comment
ctwise Posted April 17, 2013 Author Share Posted April 17, 2013 Do you need me to get on IRC or something so I can send you results more efficiently? Do you have this checked in Settings? hgl 1 Link to comment
Guest nXqd Posted April 17, 2013 Share Posted April 17, 2013 This is a brilliant idea, thanks Link to comment
hgl Posted April 17, 2013 Share Posted April 17, 2013 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
ctwise Posted April 17, 2013 Author Share Posted April 17, 2013 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
hgl Posted April 17, 2013 Share Posted April 17, 2013 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
ericwbailey Posted April 18, 2013 Share Posted April 18, 2013 This is an absolutely amazing workflow, wow. I took the liberty of whipping up a replacement icon, if you're interested. Hope you don't mind: Link to comment
vitor Posted April 23, 2013 Share Posted April 23, 2013 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. Link to comment
ctwise Posted April 23, 2013 Author Share Posted April 23, 2013 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
vitor Posted April 23, 2013 Share Posted April 23, 2013 (edited) 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 April 23, 2013 by Vítor Link to comment
donosaur Posted May 8, 2013 Share Posted May 8, 2013 This has completely changed the way I use Photoshop/Illustrator! Great job on this! Link to comment
tsvoronos Posted May 23, 2013 Share Posted May 23, 2013 Hi @ctwise, is there a way to have this show items in the Services menu as well? Link to comment
ctwise Posted May 24, 2013 Author Share Posted May 24, 2013 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. Link to comment
phyllisstein Posted May 24, 2013 Share Posted May 24, 2013 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
ctwise Posted May 24, 2013 Author Share Posted May 24, 2013 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
David Gorges Posted May 30, 2013 Share Posted May 30, 2013 This is an awesome workflow! Great idea, works perfectly. Thank you Link to comment
nitingoyal Posted May 30, 2013 Share Posted May 30, 2013 Brilliant. Suggestion : If it could also display the default keyboard shortcuts along with the menu item. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now