Jump to content

ctwise

Member
  • Posts

    307
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by ctwise

  1.  

    Here are two URL schemes that are currently available in Parcel for both OS X and iOS:
     
    1) If you have a tracking number: parcel://automatic/empty/?CODE
    where CODE is your tracking number
    2) If you have a tracking number and description: parcel://automaticwithlabel/LABEL/?CODE

    where CODE is your tracking number; LABEL is url encoded description.
     

    Can you explain how I can put both the description for the parcel (LABEL) and the tracking ID (CODE) from alfred into the url to feed Parcel?

     

     

    The app is buggy, those URLs don't work correctly. The courier (UPS, FedEx, etc.) isn't selected unless you use the keyboard to remove and then re-add a character from the tracking number.

  2. I coudn't find a color picker workflow so I converted an old alfred1 extention to an alfred2 workflow. I probably downloaded the extention from here: http://jdfwarrior.tumblr.com/post/11143489252/color-chooser

     

    the keyword is "color picker".

     

    It shows the OSX default color chooser and saves the selected color hex value in the clipboard.

     

     

    7hnuWJn.png

     

    Download the workflow here: Color Picker

     

    This one - http://www.alfredforum.com/topic/805-colors—a-css-color-conversion-workflow/?hl=eich#entry3951

     

    It's a color picker and color format converter.

  3.  

    I'm noticing a weird issue with this workflow.  I use tab completion like crazy (vim, zsh, etc.) and use it with Alfred too.  When I go to start my vm I do the following:

    • activate Alfred
    • type 'vm st<TAB>'
    • wait while list is populated
    • hit '<TAB>' to complete the line

    Now I would expect the Alfred line to be "vm start VM_NAME_TO_START", however it reads "vm start Start VM_NAME_TO_START" and if I hit <enter> now, the command executes but VMWare doesn't acknowledge the command.

     

    Instead to get a machine to launch I have to do the following:

    • activate Alfred
    • type 'vm st<TAB>'
    • wait while list is populated
    • arrow to VM
    • hit '<enter>'

     

     

    Yes, autocomplete doesn't work. There's no guarantees that the vm names are unique and that means autocompleting names isn't sufficient. What I should do is completely disable autocomplete.

  4. I'd like to make a Custom Search for www.peekyou.com but there needs to be an underscore between words. I have no idea how to do this. Can somebody help?

     

    1. Create an empty workflow.

     

    2. Create a keyword input, use 'peekyou' or whatever else you like as the keyword.

     

    3. Add a script action, the default is a bash script, that's what you want.

     

    4. Paste this as the script: echo "{query}" | sed -e "s/ /_/g" | tr -d '\n'

     

    5. Check escape double quotes and nothing else.

     

    6. Add a script output, bash again.

     

    7. Paste this as the script: open "http://peekyou.com/{query}"

     

    8. Escape double quotes again.

     

    9. Connect the keyword to the first script and the first script to the second script.

     

    Done.

  5. I am having the same issue reported by mjv above. Also on 10.8.3 and Alfred 2.0.3.

     

    This is a great idea for a workflow. Thanks to author for his efforts.

     

    What does this command show when pasted into the terminal?

    mdfind -0 'kMDItemOMUserTags == *' | xargs -0 mdls -name "kMDItemOMUserTags" | grep "^    " | cut -c 5- | sed -e "s/,$//" | sort -u
    
  6. that's a great approach... do you think performance would be up to par?

     

    also any clue how the workflow would look like? I've never build one...

     

    thanks for your help

     

    Look around for other workflows that return file results, you can tailor it to what you want. A couple more hints. The locate command by default can't see your user files, you'll have to modify the /usr/libexec/locate.updatedb script to replace the 'nobody' user with your user id. When you construct the feedback xml, add 'type = "file"' to your entries and Alfred will let you right arrow on the results.

     

    If what you want isn't just a path search but a path-specific file search, then you can use mdfind instead of locate. But that doesn't seem to be what you want.

  7. Is there a workflow out there that will allow to search through an entire directly structure with fuzzy search... meaning

     

    /path/here/goes/project/this/plugins/

     

    where i could type here and plugins

     

    and press enter to be taken to /path/here/goes/project/this/plugins/

     

    thanks so much for your help...

     

    Assuming you activate the locate daemon, you can do something like this:

     

    locate vim plugin | grep "/vim/.*/plugin/"
    

     

    You can find information about building the locate database here: http://osxdaily.com/2011/11/02/enable-and-use-the-locate-command-in-the-mac-os-x-terminal/

     

    You'll have to write the workflow that uses the locate information to output a list of file paths.

  8. When you limit the files displayed in Alfred, e.g., ~/Desktop/*.jpg, with the intention of conducting an operation on all of them, e.g., delete, move, etc. You have to add all of them to the buffer individually. True, you can use the add to buffer and select next hot key to speed up the process but it would be even better to have a select all option, e.g., ⌥A, or something similar.

  9. I really enjoyed this Alfred extension for Alfred 1.x.  The extension compares files/folders selected with Alfred in the beautiful [Kaleidoscope app](http://www.kaleidoscopeapp.com/). I missed this functionality in Alfred 2 and decided to setup the same file action as an Alfred workflow.
     
    Download it here.
     
    Thanks to Jay Freestone, author of the "Stale Coffee" blog, for creating the original extension.
     
    Related: Someone has also created an Alfred workflow to compare items selected in the Finder: http://www.alfredforum.com/topic/1432-compare-finder-items-in-kaleidoscope/?hl=kaleidoscope

     

    Very useful. And you can use the built-in Alfred hotkey to get file selections from Finder w/o installing yet another workflow.

  10. I’ve recently started using Path Finder, which allows me to essentially kill Finder, and work only with it. However, it seems that empty trash does not check for this. From what I understand, reading the forum, maybe this should be Path Finder’s job (informing Alfred of this case), but other options like “Reveal in Finder” and ejecting media, work correctly, so maybe Alfred is doing something specific with Finder, here.

    I’ve mocked up a quick way of how I’d see this working

    # Check for Finder and alternatives
    tell application "System Events" to set isFinderRunning to (name of processes) contains "Finder"
    tell application "System Events" to set isPathFinderRunning to (name of processes) contains "Path Finder"
    
    # Empty the trash
    if (isFinderRunning) then
    	tell application "Finder" to empty trash
    	
    else if (isPathFinderRunning) then
    	# Get frontmost app
    	tell application "System Events" to set frontApp to name of first process whose frontmost is true
    	
    	# Empty trash
    	tell application "Path Finder"
    		activate
    		empty
    	end tell
    	
    	# Return to frontmost app
    	tell application frontApp to activate
    	
    end if
    

    This would also leave room for other implementations with other Finder alternatives; it still gives it precedence, but if it isn’t already open, it won’t call it. Maybe Alfred isn’t using AppleScript at all for this, but that’s just a quick mockup to open the discussion and see if it would be a possibility.

     

    I'll also add, as a fellow Path Finder user, that you can't effectively disable Finder. Path Finder does some tricks to get about 90% of the way there but that last 10% is unavoidable. Most new Path Finder users give it a shot and end up disabling the use of Path Finder as a full Finder replacement. The rough edges just get too annoying. Setup a hot key to activate Path Finder and you'll forget Finder is even there most of the time.

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

  12. On first start up, Alfred should do a quick sanity check, scanning the /Applications folder and checking to see if the applications can be found through Spotlight. If they can't, Alfred should display a pop-up box informing the user that Spotlight is either disabled or their index needs to be rebuilt.

     

    This would greatly diminish the "Alfred can't find my applications" bug reports.

     

  13. Hi Ted, thank you so much for your fast response, I really appreciate it!

     

    I feel like an idiot, but I don't get any output from the Ruby script...

    I have connected the keyword trigger to a "run script" module (/usr/bin/ruby) and added a "large type" module at the end - but nothing happens when I type the keyword. I don't get an error in Console app either.

     

    I have never had anything to do with Ruby, but Terminal tells me I have version 1.8.7 (thanks, Google!) and I'm on a recent Mac with 10.8.3. - is there anything else I need to install?

     

    Thanks again for your help :)

     

    I edited my reply since I forgot the require statement. Try the updated code.

  14. Hi Ted!

     

    Thank you very much for the workflow! I tried to cobble something similar together myself - but since I really know nothing about scripting I was glad to find your workflow :)

     

    I do have one question though: when I was working on my own workflow for Time Machine I tried to get a notification that shows me the time/date of the last completed backup. I even found a script that will do just that:

     

    date -jf "%Y-%m-%d-%H%M%S" "$(tmutil latestbackup | sed 's|.*/||')" +"%F %T"

     

    But for it to work the backup drives have to be mounted. Since I use two different drives for Time Machine and one of them is a Time Capsule, that script would always mount the drive first - not a perfect solution... so I kept searching and found this:

     

    http://goo.gl/oVCWK

     

    But I couldn't make it work. Would it be difficult to add that feature to your workflow? Or maybe you can give me some advice on how I could add it myself, that would be great :) All I really want is a notification with the time/date of the last backup, it doesn't have to be part of the script filter. 

     

    Thanks and cheers, Anna

     

    You can build a quick workflow yourself. Create the workflow, trigger it with a keyword of your choice, connect it to a Ruby script and paste this in the box:

     

    require 'date'
    puts DateTime.strptime((`defaults read /private/var/db/.TimeMachine.Results BACKUP_COMPLETED_DATE`.strip), "%Y-%m-%d %H:%M:%S %z").new_offset(DateTime.now.offset).strftime("%A %B %d, %Y %l:%M %P")
    

     

    And connect the script to a display large type output.

  15. Dear Alfred community!

     

    I really need your help and I hope I don't annoy anybody out there, by making a request. Could somebody make a workflow, that enables/disables the Proxy settings? I would really appreciate if somebody helps me out!

     

    Thanks

    Stefan

     

    Create a workflow with keyword or hot key trigger and connect it to an AppleScript:

     

    do shell script "sudo networksetup -setwebproxystate airport off" with administrator privileges
    

     

    That will turn the proxy _off_ for the airport network interface (WiFi). Replace the 'airport off' with 'airport on' for a script that will turn the proxy back on. You will get an OS/X login box to authenticate when it runs.

  16. I love using Alfred for browsing my directories, but as a long time linux user I have the muscle memory to type a forward slash immediately after typing ~ for my home directory. However, Alfred automatically puts a forward slash in for you and I end up with two. Is there a way to stop it from doing this?

     

    Thanks!

     

    Couldn't agree more. Or, just ignore an immediate forward slash.

  17. Network.

     

    Convert this:

    smb://NetworkDrive.corp.YYYY.com/Files/Folder/Folder

     

    To this:

    \\NetworkDrive\files\Folder\Folder

     

     

     

    - and - 

     

    Convert this:

    afp://NetworkDrive/Folder/Folder/

     

    To this:

    \\NetworkDrive\Folder\Folder\

     

    Create a workflow, trigger it with a keyword that requires an argument, connect it to run a script, choose Ruby as the script language, and paste this in:

     

    path = "{query}"
    unc = ""
    
    if (path.start_with?('smb:'))
    	# smb://NetworkDrive.corp.YYYY.com/Files/Folder/Folder
    
    	parts = path.split('//') 			# ["smb:", "NetworkDrive.corp.YYYY.com/Files/Folder/Folder"]
    	path_parts = parts[1].split('/') 		# ["NetworkDrive.corp.YYYY.com", "Files", "Folder", "Folder"]
    	server_parts = path_parts[0].split('.')         # ["NetworkDrive", "corp", "YYYY", "com"]
    	unc = "\\\\#{server_parts[0]}\\#{path_parts[1..-1].join('\\')}"
    else
    	# afp://NetworkDrive/Folder/Folder/
    
    	parts = path.split('//') 			# ["afp:", "NetworkDrive/Folder/Folder"]
    	path_parts = parts[1].split('/') 		# ["NetworkDrive", "Files", "Folder", "Folder"]
    	unc = "\\\\#{path_parts.join('\\')}"
    end
    
    puts unc
    

     

    Then connect a copy to clipboard output (or large type or whatever else you like) to the script.

  18. I can understand how this could be useful in concept and I've made a note to have a think about this, however, there are many unanswered questions in how the subsequent filtering would actually work to keep things consistent across Alfred.

     

    Could you give an example [real life] of where you would use this one-shot type filter?

     

    Also, as Alfred only runs a script filter a second time once the first run has fully completed, have you thought about just writing your results to a temporary file and reading them out of there instead on the second request. I'm sure David is doing this kind of caching in a number of places.

     

    Caching to a temporary file only works when the results aren't time or location dependent. It's also not possible to effectively provide any other caching since Alfred doesn't give you a session-specific key that lets you tie one script invocation to another, e.g., a UUID that says script invocation #2, #3, etc. are later invocations for the same keyboard entry (looking at whether the text is a superstring of the previous invocation isn't reliable enough).

     

    A real-world example is the menus workflow. For large applications it can take half a second to a second and a half to dump a menu structure. Even a half second throws off the user since the lag in results update makes for confusing feedback. If you could dump the menu structure at the start of typing and let Alfred filter the results, it would be much cleaner (and much more efficient).

     

    Other examples which would benefit from but don't necessarily require this, would be: a list of recent documents, a list of running processes, a list of mail messages, a list of bonjour results, a list of git repositories, a list of tasks, etc. In all of those examples, the script most likely dumps out a whole list and then uses script filtering to reduce the list down to match what the user is typing.

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

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

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

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

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

×
×
  • Create New...