Repeat last command Alfred extension

I thought it could be useful if there was a way to tell Alfred to repeat the last command issued. I know that there is the option to remember the last query (in Appearance->Options you can turn it on).

So I made a little extension that is nothing more than a trick to tell Alfred to repeat last command (having the “Remember the last query” option activated).

After installing this extension (download here) you must create a global hotkey that call it.

I’ve chosen to assign the double tap on CTRL key (for a reason that I’ll explain below)

This extension come in handy used with command like another extension I have made (this one that let you apply a text filter to the selected text in any application – almost any).

Just an example (using the Filter extension):

1) I have a text document and I have to change several word to UPPERCASE – I select the first word and issue a “flt uc” command with Alfred

2) for the other words I only have to select the word and double tap on the CTRL key (the Repeat extension invokes Alfred and tell him to repeat the “fly uc” command)

There are some caveats:

1) the hotkey to invoke Alfred is hardcoded in the source of the extension (maybe there is a way to get it automatically but I had not time to investigate). At this time it’s my Alfred hotkey: OPTION + SPACE – If you have another key combo to invoke it you must change the extension accordingly.

2) theĀ ”Remember the last query” option in Appearance->Options must be activated

3) the extension send a RETURN keystroke to Alfred after invoking it so the command that is executed is the first listed by the last query.

4) the extension wait for a short time for the Alfred window to appear, you can change it and see how it works for you.

5) I’ve chosen to assign a double tap CTRL key combo to the Repeat hotkey because when the applescript of the extension send the keystrokes there must not be other key pressed. Otherwise it does not work.

The last thought is that perhaps it could be handy if there was a “Repeat last command” internal command in Alfred to be assigned directly to a global hotkey. An idea for Andrew…

This entry was posted in OSX. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. JD
    Posted July 29, 2014 at 12:18 pm | Permalink

    Hello,
    i am new to alfred and can’t get your plugin to work. I put it in the workflows folder, but the alfred prefs are crashing now every time i try to open it. How do i install the plugin correctly?
    Thanks!

  2. maxtofa
    Posted July 29, 2014 at 3:36 pm | Permalink

    Sorry but the plugin was for an older version of alfred.
    You need perhaps to completely uninstall it.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>