Jump to content

Benzi

Member
  • Posts

    146
  • Joined

  • Last visited

  • Days Won

    25

Everything posted by Benzi

  1. Pretty neat and useful :-). Saves time from the normal printing to PDF route I made two modifications so that this now works with both Safari and Chrome checks if wkpdf is installed first, if not prompt user with a message to check the readme Here is the updated one - hope this helps...Cheers!
  2. Hi Florian, This happens because VLC changes its menu contents based on context. When a file is not open, the Video > Subtitles Track menu is disabled. But, it has the Open File... sub menu item internally (though not accessible from the UI physically). Now if you open a video file that has subtitles that VLC can load, the Disable option gets added to Video > Subtitles Track dynamically. The way the original workflow works is that it caches the contents of the menu items only once. So, if you had VLC open at the time the sub menu items were not present, the menu cache will not have those (and the menu cache is used to search for appropriate commands). Since this depends entirely on the state of the application and when exactly the cache gets created, outcome will be different for different users. (I faced similar issues in Chrome, where a menu item renames from Enter Presentation Mode to Exit Presentation Mode). In short, you need to tell the workflow to re-cache the menu entries. The original workflow does not have that option, but I modified it to include an option "m :refresh" to recreate the cache on demand. You can either download my modified version or you can go to you /tmp folder and delete the cache manually, and then try searching for Disable when VLC has that menu item in place (when using the original version). Hope this helps. (PS this problem is more general, and I see this in many other apps apart from VLC and Chrome...)
  3. For the two word issue, can you please downloading the version again? I noticed this myself a bit late, but I hope this is now fixed. If you have en setup as default, searching for "muller thomas" should bring up "Thomas Müller" as follows
  4. Also if you have on recurseMenu(menustuff) tell application "System Events" set menuItems to {} repeat with menu_level1 in every menu of menustuff set level2menus to (name of every menu item of menu_level1 whose name is not missing value) set menuItems to menuItems & (name of menu_level1) & {level2menus} end repeat end tell end recurseMenu It will give you output as: { "Level 1 Menu A" , { "A subitem 1", "A subitem 2", "A subitem 3" } , "Level 2 Menu B", { "B subitem 1", "B subitem 2"} ....and so on } Some code wrangling needed to get it truly recursive. (No idea how fast this will be too...)
  5. Try: on recurseMenu(menustuff) tell application "System Events" return menus of menustuff end tell end recurseMenu Also have a look at this code snippet from GitHub/FreeKalter I dont' know why its written that way with a fixed depth, but the comment says "This script uses UI element scripting to return a list of every menuitem of every menu for every application currently running."
  6. Hi all, thanks to all your feedback, I have created a new version put up here, with slightly better support for multi language search. See the first post in this topic for details and try it out.
  7. Here is my version that I am using for your reference. It is based on the version from Ted, the code for which is located in GitHub at: https://github.com/ctwise/alfred-workflows NOTE: Code changes to main.rb for setting application and application_location variables I have included a command "m :refresh", which will refresh the menu cache of the frontmost application. Some applications have dynamic menu bar items, e.g. Chrome will populates the history menu with the URL you have visited. If you want to force a cache refresh, use this command I am contributing code back to Ted via GitHub, so eventually that would be the place to look.
  8. Hi, awesome workflow! I am using ctwise's version and its working great overall. A couple of issues I noticed were to do with the workflow trying to find the application_location variable in main.rb and because of which the menu command icons for the specific application would not show up e.g. for Alfred Preferences, the menu commands icon were that of an empty file icon for Google Chrome in full screen mode (Lion), the icon would not be shown. No issues in normal mode. The following lines were added/changed in main.rb to fix most of the issues I found. application = `osascript frontapp.scpt | sed -E 's/application process //'`.strip application_location = `mdfind "kMDItemDisplayName=#{application}.app" | grep -i [.]app | head -n 1`.strip if application_location.length == 0 application_location = `mdfind "#{application}.app" | head -n 1`.strip end if application == "Alfred Preferences" # overall, there should be some other way I suppose... application_location = "/Applications/Alfred 2.app/Contents/Preferences/Alfred Preferences.app" end For what its worth, hope this is useful for someone... EDIT (for developers): For checking if the application and application_location variables are correctly set up, use this workflow. Keyword is "frontmost" and it displays App name and location of the front most app... just to test things out.
  9. Hi there, Can you try downloading the latest workflow from my original download link? After that, you need to change en.wiki to zh.wiki in two places in w.py. in search_for() rt_api = "http://zh.wikipedia.org/w/api.php" in resultParse() item_arg = u'http://zh.wikipedia.org/wiki/' + urllib.quote(item['title'].encode("utf8")) I tried that and looked up http://zh.wikipedia.org/wiki/香港最高電影票房收入列表 (well to be honest, I just typed in some Chinese characters and that was one of the search results... I have no clue what that page is about )
  10. Well... I am not very strong with Python either , but the issue was to do with Unicode encoding. So words like "Müller" were failing. I have updated my original workflow with some modifications and is available in the original download link. Since many have modified the workflow, the code change was done in w.py file, a snippet is below def resultParse(item): item_arg = u'http://en.wikipedia.org/wiki/' + urllib.quote(item['title'].encode("utf8")) return { 'uid': "." + item['title'], 'arg': item_arg, 'title': item['title'], 'subtitle': 'Read article on ' + item['title'], 'icon': 'icon.png', } As you can see, its against the English version of Wikipedia. Please check and let me know if this is of any use. Anyways, got to read about http://en.wikipedia.org/wiki/Hermann_Müller_(botanist)
  11. Could you please try downloading and installing the workflow again? This will overwrite your changes so you need to change "en.wiki" back to to "de.wiki" again. Please try searching again and see if it works. If its still not working, let me know if possible what you are searching for and I will try to check at my end. There was a small issue (maybe related to what you reported) with the script which was fixed. Thanks!
  12. Quite a simple workflow to search articles on wikipedia (English version). Inspired by a similar workflow here, but it appears the download link is broken... Based on feedback from folks, I have an updated version of this workflow. It allows you to Search against regional Wikipedia sites. E.g. to search against German wikipedia, type "w de what to search for" i.e. "w <language code> <search term>" Language codes are from Wikipedia. You can also configure it to search against just one default Wikipedia by modifying the script filter as mentioned in the workflow. Against each result, a snippet of the text from the wiki page is displayed Remember, you can press the Shift key against a search result to quickly view the associated web page from within Alfred. Try the new version and let me know your comments. Q: How can I set one language as the default? Open the workflow's Script Filter in Alfred, and follow the steps mentioned in there.
  13. Oh... Thanks for that. I have updated the workflow at the original download link to include more specific UIDs for all items. Hopefully it should resolve the problem you mentioned for everyone. Cheers
  14. Updated I've uploaded a modified version at the original download link. The workflow now includes two more options Disable for an hour Disable for a minute I strongly recommend you to see if disabling works for a minute, and then proceed to use the hour mode. Please let me know in case you face any issues.
  15. Have a quick break and read the latest Dilbert strip straight off of Alfred. This simple workflow downloads and displays the latest comic strip from www.dilbert.com. Sample strip Download the workflow and give it a go.
  16. Yes, binding it to a hotkey should be possible as follows. You need to edit the workflow to add a hotkey. Select the workflow from Alfred Preferences, and click on the + button at the top right. In the drop down menu, select Triggers > Hotkey A small window will appear, where you need to set it up as follows: (You can set the hotkey to anything of course) Once the hotkey has been added to the workflow, you need to manually drag and create a link from the hotkey box to the Run Script box towards the right of the screen. Once all done, your workflow should look something like below: NOTE: The text that you enter in the hotkey settings window controls what option you want, and you can set up multiple hotkey for all the actions mentioned below: Enter ic is for interactive to clipboard Enter c is for whole screen to clipboard Enter i is for interactive Leave blank to save the whole screen Hope this helps!
  17. This screen capture workflow in Alfred makes taking quick screenshots easy. Screenshots are saved to your Desktop or to the Clipboard based on the option you select. Download from here and give it a whirl.
  18. This little workflow pulls up facts from the Amazing Facts section out at mental_floss.com and displays them in Large Type mode. Download Its available here for download. Usage Type fact into Alfred And see a random fact appear on your screen:
  19. This is not very foolproof and is very basic at the moment, but you can change the color temperature with Flux. Update 1: Now includes option to disable Flux for a minute/hour Download it from here and check it out.
  20. This is a simple workflow that allows you to control Radium 3 from Alfred. (Latest update is version 4) Version 2 A mini-version, which shows track and station info, and lets you quickly toggle the playing state. Download from here. Version 3 Same as version 2, but the classic icons. Download from here. The first Radium icon courtesy myBaco - http://mybaco.deviantart.com/ Version 4 Oh well, another update, another icon set for Radium Download
  21. Hi, I just created a workflow for Rotten Tomatoes. Details are in this blog post, and here is a preview of it in action: NOTE: As mentioned in the blog post, you need nodejs installed for this to work (nodejs.org). ******** UPDATE1 : This now uses Python, so it should work straight up. No need to install anything extra
×
×
  • Create New...