Jump to content

BrianGilbert_

Member
  • Posts

    27
  • Joined

  • Last visited

Posts posted by BrianGilbert_

  1. In this case it's safe to assume that users will always want to copy it to the clipboard, which is why I don't want to add a modifier key.

     

    I just seems that copy to clipboard is quite limited, or if it is possible to copy more than {query}, {time}, {date} and {clipboard} there is no indication of what else available?

  2. Hi David

     

    This is for the Drupal workflow I've written, {query} is required for opening a URL, but I'd like to copy the full function including it's expected variables to the clipboard.

     

    an example:

    aggregator_admin_remove_feed_submit <-- 'arg' / {query} required for the opened url to work properly

    -https://api.drupal.org/api/drupal/7/search/{query}

    -https://api.drupal.org/api/drupal/7/search/aggregator_admin_remove_feed_submit

     

    aggregator_admin_remove_feed_submit($form, &$form_state) <-- 'title' is what I want to copy to the to clipboard

     

    Just in case it helps here is a lrger section of the code

     

    $results = array();
    foreach( $matches as $hook => $sugg ) {

      if (!empty($sugg)) {
        $value = $sugg;
      }
      else {
        $value = "";
      }

       $item = array(
        'uid' => $value['hookname'],
        'arg' => $value['hook'],
        'title' => $value['hook'],
        'subtitle' => $value['value'],
      'icon' => 'icon.png',
      );
      array_push( $results, $item );
    }

    if ( count( $results ) > 0 ):
      echo $utils->toxml( $results );
    else:
      echo '<?xml version="1.0"?><items><item uid="suggest '. $text . '" arg="none"><title>No match</title><subtitle>Try changing your search query.</subtitle><icon>error.png</icon></item></items>';
    endif;

  3. In the following workflow there are several commands that cache a local copy of data to make the workflow faster, I've just added a new command that this functionality isn't working properly for, which is strange given that the code is pretty simmilar to how the other commands that are working function.

     

    Working example:

    d7 hook_   (will download a file to data dir called d7.array)

     

    If you install the workflow https://www.dropbox.com/s/lgg7p4gkb8cs0e5/Drupal.alfredworkflow

    and then type the following (dp alfred) it should download an XML file (which is 15.2MB) and convert it into a much smaller projects.array (2.9MB) that gets saved to the data dir, this all works fine when I test it as a php script from terminal, but when I run it from Alfred I can see the network activity for the download, but the projects.array file never gets saved to disk.

     

    If I copy the projects.array file that was created when running from terminal into the data folder it works fine though.

     

    Any suggestions would be greatly appreciated.

  4.  

    This plugin caches the Drupal api function list's locally and shows the variables that the function expects to receive as well, hitting enter opens the relevant page on api.drupal.org.

     

    Drupal API lookup
    d5 [substring_of-hook]  (cached for 90 days)

    d6 [substring_of-hook]  (cached for 90 days)

    d7 [substring_of-hook]  (cached for 30 days)

    d8 [substring_of-hook]  (cached for 2 days)

     

    g.d.o
    dg [nid or group]

     

    d.o
    do [nid or project]

     

    Search Drupal site network
    ds [string to search]

     

    Drupal user
    du [user id or name]

     

    Drush (drush as per Alfred v1 Drupal plugin)
    dd d [command]  (a Drush alias with a Drush command command Action - Invokes Drush

    dd o [command]  (a Drush alias Action - Opens the URI associated with the Drush alias in a browser)

     

    Download at: http://realityloop.com/blog/2013/03/15/advanced-drupal-workflow-alfred-v2

     

  5. You have to click or swipe the original notification, but then Prowl should open then launch the phone call automatically.

     

    Would probably be a bit dodgy if you didn't have to acknowledge the original notification - then anyone could just initiate calls (or launch dodgy URLs) from your phone without your approval.

    Not unless they had access to my api key tho.. but yeah.. makes sense...

  6. Actually, no. That's odd, because you shouldn't have to do anything. It should be automatically responding to the custom URL scheme, "tel://". That setting I mentioned before should only be the difference between asking or not asking to auto-launch the phone app. I've never had to actually click the notification. In fact, that's the main reason I chose Prowl over Pushover for this extension, because Prowl would auto-launch the "tel://" URL, whereas Pushover wouldn't.

     

    The only think I can think of is maybe you have a security setting somewhere else on the iPhone that controls whether apps are allowed to act on custom URL schemes. But I don't know of any such thing. Any one else got any ideas?

    I think I edited my message while you were typing your reply.. I've now got it working so that when I open Prowl the notification launches automatically.. but I still have to load Prowl.

  7. This is true, but that makes it a lot trickier to write a simple workflow that requires personal data. Most of the workflows shared around here so far have just asked the user to enter their info in the script window, with some commented info explaining what to do. If we're going to put user info into the appropriate working folders (which, obviously, we should), then workflows that require this will have to write some kind of "input" routine into their workflow. Maybe it could be "keyword user 'myusername'" in Alfred or something, or, even better, a GUI that pops up on first run and asks for the relevant details. This would be really nice, but it's obviously quite a bit of extra work. I guess the thing to do would be for someone (any volunteers? myself perhaps?) to write a boilerplate AppleScript GUI that other workflow developers can reuse, that can be inserted at the start of the workflow and executed on first run. If you think something like this is a good idea, then maybe I'll start a thread to discuss it and get come collaborative input from others to get the ball rolling. Or has anyone got another obvious idea for how to handle user data that a) is not too much work, or B) can be generalised to be re-used by other developers?

     

    Sorry for the rambling post, just thinking "out loud", so to speak.

    I don't see why you couldn't store the information in some form of file that contains the information at the suggested paths and have your workflow load it from there to populate the variables where they need to be, I'm doing that for a workflow that I'm currently working on.

     

    edit: ah.. on fully reading your comment I see the problem is getting the input to start with..

  8. 2 Questions:

    Is it possible for helper variables for [volatile] and [non-volatile] to be added to Alfred that get expanded to the path of the relevant directory including the bundleID before the scripts are run?

    I've submitted a request for this: http://www.alfredforum.com/index.php?/topic/389-alfred-helper-variables-the-get-expanded-before-scripts-are-run/
     

    I'd like to show subtitle only when I'm downloading or updating the api list (which happens monthly, and can't run search while this is happening), is there any way to do this?

  9. example: Is it possible for helper variables for [volatile] and [non-volatile] to be added to Alfred that get expanded to the path of the relevant directory including the bundleID before the scripts are run?

     

    So if I used it in the Drupal workflow that I'm building they would be expanded to the following before any scripts containing them were run..

     

    [volatile] = '/Users/brian/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.realityloop.alfreddrupalworkflow'

     

    [non-volatile] = /Users/brian/Library/Application Support/Alfred 2/Workflow Data/com.realityloop.alfreddrupalworkflow

×
×
  • Create New...