Jump to content

ctwise

Member
  • Posts

    307
  • Joined

  • Last visited

  • Days Won

    23

Posts posted by ctwise

  1. it's really a good one

     

    I've found a strange behavior. if you type "pubmed rochebro" you wait and it gives you the articles linked to the authors. this if fine.

     

    But you add more letters to finish the author name (the complete name is rochebrochard) and / or delete some, at some point you have the search google /  amazon / wikipedia for "pubmed xxx"

     

    It looks like a bug, bug I'm not sure if it's Alfred's or not.

     

    It's a bug in the workflow, due to UTF-8 encoding. Fixed and a new version was uploaded.

  2. Alfred always waits for a single script filter object to finish before calling it again, so if it calls on the first character you press and takes a few seconds to reply, it will only get called again with the current query at this point (e.g. if you have typed 6 further characters, the script gets called with these 6 characters, not all the separate times inbetween).

     

    That's good to know but if a script takes five seconds to return results and I type the query 'avengers', then I get script results for 'a' and ten seconds later I get script results for 'avengers' as opposed to five and a half seconds later for a timeout of 500 milliseconds.

  3. Script filters fire for every key press. That is fine for lightweight script filters that can respond quickly but is a problem for heavy script filters that take significant time to operate. It would be helpful to support script filter throttling. This might be as simple as a checkbox ("Throttle requests"). It would work by waiting a short time between key presses, if another key is pressed the timer resets, if the timer expires the script filter is run.

     

    It's possible to emulate this in a script but it's such a common use case it would be helpful to have it in Alfred.

  4. The workflow has been updated, both at the above link and on alfpt. I added the following:

     

    vm list - now copies the vmx path to the clipboard

    vm ip - list the ip addresses of all running vms and copies the selected ip to the clipboard. The vm _must_ be running vmware tools for this to work.

    vm revert <name> - revert a vm to the named snapshot.

  5. This intrigued me so I came at it in two different ways. One script filter looks up the term being entered and provides a list of articles with titles, dates and authors. Choosing one of the entries takes you directly to the summary page.

     

    The other script filter does an autocomplete for search terms, e.g., 'diabetes' gives you options like 'diabetes mellitus'. Choosing one of the entries takes you to a search page for that search query.

     

    Pick your poison.

     

     

     
  6. I created a workflow inspired by the Parallels controller workflow. It doesn't do screen captures since VMWare requires a username / password to do that, otherwise it's pretty similar. It's on alfpt or you can download it from here: http://tedwi.se/u/d4

     

    The following commands are available:

     

     

    vm list - Provides a list of VM's and their status (running or stopped). Copies path to clipboard.
    vm start [nogui] - List the VM's that are currently stopped so you can start them. Optionally, if you add 'nogui' it will start them without showing the VMWare window.
    vm stop [hard] / vm suspend [hard] / vm reset [hard] - List the VM's that are currently running so you can stop, suspend or reset them. Optionally, if you add 'hard' it will force the action.
    vm pause / vm unpause - Get a list of VM's that are currently running so you can pause or unpause them. A paused VM counts as running.
    vm snapshot <name> - Get a list of VM's that are currently running so you can create a named snapshot of a VM's current state, 'name' is not optional.
    vm ip - List the ip addresses of all running vms and copies the selected ip to the clipboard. The vm _must_ be running vmware tools for this to work.
    vm revert <name> - revert a vm to the named snapshot.
     
    2013-02-07 - Add icons (cribbed from Jonas Erikson's VirtualBox controller)
  7. Why not just specify path to the executable? Also, are you sure that PATH isn't available? I can easily get values for HOME and other variables from bash scripts.

     

    In this specific example the idea would be to offer suggestions, e.g., 'run mount' would give you the '/sbin/mount' command, but 'run <some script in some other bin directory>' would give me that option. If I dump the PATH from a script in Alfred it's not the full path set by .bashrc, indicating it's not running a login shell (which it shouldn't by default).

  8. One input and one output for each module in a workflow makes it easy to understand and use.

    Also it is possible to connect multiple triggers and script modules to one script module so the modules cannot have a "knowledge" of the pipeline they are in.

     

    And as phyllisstein David said, you can always nest your queries with a delimiter and pass them on to the next module...

     

    If I embed the information in the value returned by an earlier stage that couples later stages _more_ tightly, not less.

  9. The Google Search workflow is awesome but has one small issue - if there are no search suggestions it ends up searching google for 'g {query}' instead of just '{query}'. It can be remedied with one small change to the script filter, adding an item to the suggestion list if no suggestions were found, e.g.:

     

     

    require_once('extension_utils.php');
    $utils = new ExtensionUtils();
     
    $results = array();
    $text = urlencode("{query}");
     
    foreach( $xml as $sugg ):
    $item = array(
    'uid' => 'suggest {query}',
    'arg' => $sugg->suggestion->attributes()->data,
    'title' => ucwords($sugg->suggestion->attributes()->data),
    'subtitle' => 'Search Google for '. $sugg->suggestion->attributes()->data,
    'icon' => 'icon.png',
    'valid' => 'yes'
    );
    array_push( $results, $item );
    endforeach;
    if ( count($results) == 0 ):
    $item = array(
    'uid' => 'suggest {query}',
    'arg' => '{query}',
    'title' => '{query}',
    'subtitle' => 'Search Google for '. '{query}',
    'icon' => 'icon.png',
    'valid' => 'yes'
    );
    array_push( $results, $item);
    endif;
     
    if ( count( $results ) > 0 ):
    echo $utils->arrayToXml( $results );
    endif;
  10. The problem isn't in a single script, it's between workflow components. For example, if I have a script filter followed by a script to handle the result of the script filter and want a notification at the end along the lines of 'Uploaded file {original-query} to {query}'. I can't do it. I can get halfway there by returning the whole notification line as the value of the script _after_ the script filter, but even then I've already lost the original query and have to go through gyrations in the script filter to compensate.

  11. This is a workflow to support killing a process (as opposed to quitting an app). It uses the new infrastructure to list the processes that match a given name, e.g., 'kill java' will list all of the processes that include 'java' in their names. Holding down 'alt' will do a 'kill -9' instead of a regular kill.

     

     

    Script url for download - http://tedwi.se/u/cx
     
    This is my first workflow in the v2 beta so I'm looking for input as well.
     
    Ted Wise
     
×
×
  • Create New...