Jump to content

tonio

Member
  • Posts

    8
  • Joined

  • Last visited

Posts posted by tonio

  1. If you read The Daily WTF (http://www.thedailywtf.com/), you might've come across articles by Remy Porter, who includes html comments intended for the readers, and in whose articles you can find a word or phrase you can click on to add unicorns to the page.  This Workflow adds a keyword ('remify') which makes the html comments visible, and adds a pink background to the word or phrase which will trigger the unicorns.  (I take no credit for the actual JavaScript code... I did tweak it a little bit, but it was copied off some post in The Daily WTF site.)

     

    If you're in the Software Development or IT business, and don't know about the site, I recommend it. =)

     

    Get the Workflow here: Remify

  2. Currently, the only output actions available are "notification", "clipboard", "large text", and "run script".  An option to display the output, either buffered or live, in a window would be nice.  I'm currently working on a workflow which has a large amount of output, large enough not to fit in a notification.  I'm using Terminal Command to display the output, but it's far from an optimal solution, especially since I can't pipe the output of a script into the input {query} of a terminal command.

  3. I'm coming to Alfred from Launchbar, and one of the best features of Launchbar is the ability to assign any abbreviation to a file or application. Even if I wanted to do something as silly as have Adobe Photoshop pop up when I type "Bob," I could do that. More realistically, if I wanted "adw" to pull up Adobe Dreamweaver, I could do that as well. In v2, workflows allow me to do that but I have to manually create each one. Have you thought of having an action called "Assign Keyword" that would prompt the user for a keyword abbreviation and that would automatically be saved as a workflow (with the app icon even)? That would be useful for me,  and perhaps others. Thanks.

     

    Doug

    I believe you can already do that by selecting the application in Finder, hitting CMD+I (or selecting "Get Info" from the context menu), and entering "bob" in the "Spotlight comments" section.  Alfred uses the spotlight comments when matching applications.

  4. I think http://www.alfredforum.com/topic/96-understanding-argument-types-in-keywords-and-script-filters/ will help you. It explains the behavior of each input method.

    Cheers :)

     

    It does, and it confirms my fear... the script won't run if the argument is required until you start typing an argument. :(

    Is this behavior set in stone?  It seems kind of arbitrary to me... in fact, it would make more sense the other way around: if the argument is required, present the options; if it's not, don't present any options unless and until the user starts typing one (since it's entirely valid not to enter an option).

  5. When I've set "Argument Required" on my script filter, I notice that the options list isn't populated until I start typing an argument.  With "Argument Optional", it's populated as soon as I type the keyword.  Is there any way to force the list to be populated with "Argument Required"?  I'd like to show the user a list of possible arguments to pick from, without requiring them to "guess".  Or, alternatively (and possibly better), have there be a default argument when none is selected.

  6. Tonio,

     

    A run script action is essentially the same thing as a terminal command (as long as you have the language on it set correctly (/bin/bash). So, for your example, could simply do...

    userinput="{query}"
    
    if [ -z $userinput ]; then
      userinput="default value";
    fi
    
    // rest of your code here
    

     

    That would take what the user enters (or nothing) and set that value to the variable userinput. It then checks to see if that value is empty and if so, assigns a default value to it, then would proceed on to do anything else you wanted.

     

    Hope this help. Let me know if you have any other questions

     

    Yeah, that was my first thought... but the command I'm running has a lot of output and takes some time to run, which is why I opted for the terminal command action (so the user would see the output as it's being generated).

     

    Notification and Large Script clearly won't cut if as output targets, since the output's too long.  I guess I could pipe it to a Run Script output which opens up a tcl/tk window, or something like that, with the output... but since Terminal Command fit the bill so well, I'm hesistant to try to hack my way around it. =/

  7. Is there any way to pass a script action's output to a Terminal Command action?

     

    I'm basically trying to set a default argument if no argument is set (the keyword's argument is optional) using a script action, and then pass that to a terminal command, but I find I can't "connect" the output of the script to the input of the terminal command action.  Am I missing something?

×
×
  • Create New...