Jump to content

vitor

Staff
  • Posts

    8,518
  • Joined

  • Last visited

  • Days Won

    710

Posts posted by vitor

  1. Do you have a github repo for this? There are some details of my PinAdd workflow that I think would be nice additions to this — configuring without the need to manually alter the script, and support for more browsers (each of them needs a different Applescript way of getting the frontmost tab url).

    If not, would you mind if I took a crack at it?

  2. You may find this useful. If you set your terminal application to 'Custom' in Alfred's settings, then you can do something like the below. It runs the shell command in the current terminal without starting up a new terminal window. I use iTerm2, if you're using Terminal.app the AppleScript will be slightly different.

     

    I’ve seen that code of yours before (in fact, I’d like to be able to do a variation on it), but it still has a fundamental difference — it needs the terminal, which means it’ll still make you wait, if you do not have it open.

    Even though I run a lot of commands, I do not like to keep the terminal open at all times. To me, if it’s open it means it’s doing something, which is one of the clues I use while I work. This workflow scratches a specific itch, when I want to run quick commands, but waiting for the terminal to start is annoying.

  3. You don't have to remove the key at all if you want to push a new version. I'm storing it in the non-volatile workflow directory (~/Library/Application Support/Alfred 2/Workflow Data/nl.jeroenseegers.Alfred.Github) so it will remain after updates as well and it won't get pushed with a new version!

     

    You’re right. I prefer to store it in the workflow’s directory so it syncs, but I can certainly understand the decision to keep it there.

  4. This crossed my mind as well. Another way I thought of this is to store the OAuth token in a separate file so it will be remembered after an update as well (currently it isn't), this way I can also check if that file is present, with content, and if so, I wont show the 'auth' command.

     

    That’s also how I’ve set it up to work in PinAdd. Another advantage of it is that it’s also easier to update, since every time you want to push a new version you simply remove that file from the directory, instead of having to manually remove the key from the script.

  5. When you have two commands (“gh” and “gh_auth”) people will constantly see the auth command when wanting to do the other, which in my view adds some unnecessary visual clutter (seeing as it’s a command that’ll only be run once).

    I’d make a suggestion, which is similar to what I’ve implemented on PinAdd — make it an action modifier

    AUntLTv.png

  6. (…) be sure to enter your own username and password in the script filter within the workflow. (These aren't stored anywhere outside of the script filter (…)

     

    It can still be seen as a security risk (albeit only in very specific cases). Since it’s saved in plaintext, someone can still snoop around (not to mention it’ll probably be uploaded do Dropbox).

    Maybe there’s an easy way to do it via OAuth.

  7. Update.

    Previously this would get your command and run it with the files as arguments at the end. You can now pick where the file arguments should go in the command (this is optional), by using “{}” (original post updated to reflect this information).

     

    Great workflow!
    I personally added a "Large Type" at the end of the runcommand, otherwise I had no idea how the command ended

     
    Thank you. It now outputs a notification by default, with the output of the command. This way it can show a notification when you ask (when using “‐v”, for example), and not when you don’t.

  8. Usage


    Run shell commands without opening a terminal via the cmd keyword. Your shell’s configuration files will be loaded, making your custom aliases, functions, and more available to the environment. Commands execute relative to the frontmost Finder window to allow quick changes on the current working folder. Exit status is shown as a notification and output in a Text View.


    cmd.png

    • ↩ Run the command.
    • ⌘↩ Run command but do not open output in Text View.
    • ⌥↩ Show command history to rerun a command.

    Use the Universal Action to send files and text as arguments to a command. If the placeholder from the Workflow’s Configuration is present in the text, it will be replaced with your arguments, otherwise they are appended to the end.


    ua.png


    uacommand.png


    The same modifiers apply. Separate command histories are created for commands ran with the Keyword or the Universal Action.


    history.png

    • ↩ Run command.
    • ⌘↩ Delete all command histories and saved outputs.
    • ⌘Y (or tap ⇧) Quick Look saved output.

    ⤓ Install on the Alfred Gallery | Source

  9. LastPass runs only in the browser and needs decryption, so it can be a bit tricky, as you’d probably need to communicate with it via the extension. Also, bear in mind that the 1Password integration doesn’t do everything (like copying passwords directly), with reason.
     
    I somehow doubt Alfred will integrate with LastPass, at least in the near future, but if it’s possible/feasible, your best bet is to make a request for a workflow.

  10. This workflow is officially deprecated. It was released to the public domain, so I leave the record here if anyone is interested. You can still find the old source on Github.

     

    Output info from videos from a plethora of video sources, even when embedded in other pages.


    Copy a link to your clipboard, run vidur and pick your verbosity level. It’ll output the video’s link with its duration and optionally its title and description.


    wWasGFT.png


    The Universal Action and Hotkey can act on a selected link.


    The default_verbosity Workflow Environment Variable applies to everything but the List Filter. It must be succint, medium, or verbose.

     

  11. Interesting... Oddly enough I've never personally had any issues. I use multiple monitors and my dock sits on the left side, but hidden. All the keyboard triggers work as you'd expect. 

     

    That's probably why you haven’t noticed (because it’s hidden). If you notice (at least with the original script), if the dock is at the bottom and visible, resizes take that into account, but when it’s at the sides, windows go behind it, which gets very annoying, very fast.

  12. Another update. I followed a different route from the original thinking and ended up opting for using a script that’s called with different parameters, depending on the bookmark being saved with your default privacy setting, or as private. It will allow for easier editing, which also makes it easier to contribute to.

  13. Unfortunately, it still suffers from the same flaw that made me stop using it. The other developer clearly abandoned it, but maybe you’ll want to take on the task of fixing it. basically it does not work properly when the dock is in any position but the bottom.

     

    Personally, I use another app for window management, but if you want to take on this bug, you basically would just need to refactor the calculations depending on the dock’s position. I give some details on how you can get the position, on the original repo (https://github.com/jgallen23/layouts/issues/4).

  14. You can put your code to file that's stored in workflow folder and parameterize it instead of keeping two copies.

     

    Well, yes, in theory. However, the script doesn’t simply read variables, it also writes them, and those do not survive from one session to the other (one script to the next). Yes, I could also write these variables to a file every time and then read them back, but then instead of having two similar pieces of code, I’d have two slightly smaller pieces that read the variables, a third one that writes them, and another file to keep them. At this point, complexity is being created needlessly. It’s similar code, yes, but it ends up being smaller and more easily maintainable than the alternative. The way the workflows work, it also means that less code needs to run, even, because it’ll either do one or the other without needing to pass through an intermediary.

  15. Like I said, many of those operations could be achieved with ImageMagick. Were I to do a workflow for this, I’d probably rely on it, but I’d still have to think on what exactly to do in case the user does not have it installed, and how to interpret the multitude of options it provides. I probably won’t tackle that particular problem, at least in the near future, since the fact that ImageMagick is so capable is actually why it’s likely not worth porting to a general use workflow. Alfred’s workflows (and extensions, previously) are great for a lot of command‐line tasks for which it’s cumbersome to open a terminal just to execute, but they’re not ideal for everything, and this, I think, is one of those cases, as the commands would need to grow so complex that you’d essentially just be running the cli command in Alfred (which is something you can already do).
     
    That said, that script that simply converts an image between a .jpg and a .png is a good candidate for a workflow, and it is fairly simple. 
     
    I did not port it, but I can quickly walk you through the process of doing it, so you’ll be able to do it for any other workflows you need to.
     
    1. Download the extension
    2. Extract the files from within it (a .alfredextension file is simply a .zip file renamed)
    3. Locate the “info.plist” file inside, and open it
    4. Find the bash executable code (it’s the multiline code enclosed by <script> and </script> tags), and copy it (minus the tags)
    5. Create a new blank workflow and call it whatever you want.
    6. Press the “+” and do Triggers → File Action, followed by the command you want to use to execute it
    7. Again “+”, but this time do Actions → Run Script, and inside the box, paste the code you copied earlier
    9. Connect the two, and you should be done
     
    If you need some help/clarification with any of the steps, feel free to ask.

    Also, regarding the other conversion

    something that allows me to convert doc and docx files to pdf...

     
    For that particular problem, a quick google search revealed this http://onabai.wordpress.com/2012/07/10/convert-word-files-docdocx-to-pdf-in-osx/, which should cover your needs.

  16. it would be cool if user could set if bookmark should be shared with Action Modifier.

     

    Even though I don’t really like the idea of keeping two very similar pieces of code for this, I do think it’s a nice addition that could make this more useful to many people.

     

    It’s added (you just need to download the file again, if you had the workflow already installed). Using “opt” (“alt”) as a modifier key adds the bookmark as private. Bear in mind that if you have your Pinboard account set to “save all bookmarks as private”, then this will make no difference to you, as the regular command would already add them as private (it’s just how the API works, the default changes according to your settings).

     

    I’ve also removed the “pinset” option. Now, to add/edit the settings you just use the “pin” command but with “shift” as a modifier key. It’s not worth it to have an entirely different option for an action you’ll do once.

×
×
  • Create New...