Jump to content

vitor

Staff
  • Posts

    8,568
  • Joined

  • Last visited

  • Days Won

    714

Reputation Activity

  1. Like
    vitor got a reaction from tim.zimmermann in Is there a way to auto refresh results?   
    Possible? Definitely. Pretty? Not in the slightest.
    I’ve been running some tests, and this is what I ended up with.
  2. Like
    vitor got a reaction from JvdMeulen in iMessage focus with part of name/handle   
    So far, it seems to work great, thank you for this. May I suggest Alleyoop integration?
    Also, I think it’d be interesting that if you typed “im” (without a name), it would just show the currently online contacts (this would only make sense for the gmail contacts, naturally).
  3. Like
    vitor got a reaction from zholmquist in Search Animated Gifs Workflow   
    It’s not a space, it’s a newline. You’re outputting it when you use python’s print, and it’s then being read by the bash command.
     
    You can pretty much replace the python and bash modules with a single bash module containing

    search=$(echo "{query}" | sed 's/ /-/g') open "http://giphy.com/tags/${search}" That’ll do the same thing (without the extra stuff at the end of the url), with less code.
  4. Like
    vitor got a reaction from altryne in Search, Download and Install mac apps   
    You don’t even need to go through that trouble, you can simply run brew cask alfred, and you get the integration, the command is there precisely for that. The other points are valid, though.
  5. Like
    vitor got a reaction from dan_djorgi in Download Media — Download video and audio from web pages   
    It by default downloads the best quality version available, so it will download different formats for different videos.
     
    That said, yes, it’s very easy to do what you want. On the workflow, double‐click the “Run Script” option, and replace the code with this one
    if [[ "{query}" == "addToWatchList" ]]; then watchlist="${HOME}/Library/Application Support/Alfred 2/Workflow Data/com.vitorgalvao.alfred.watchlist/watchlist.txt" filename=$(python youtube-dl -f 22/18/17 -o "${HOME}/Downloads/%(title)s.%(ext)s" --get-filename "$(pbpaste)") python youtube-dl -f 22/18/17 -o "${HOME}/Downloads/%(title)s.%(ext)s" "$(pbpaste)" echo "${filename}" >> "${watchlist}" echo "Done." else python youtube-dl -f 22/18/17 -o "${HOME}/Desktop/%(title)s.%(ext)s" "$(pbpaste)" echo "Done." fi The solution is the -f 22/18/17 option, which will download the best version available of either mp4 [720x1280], mp4 [360x640], or mp4 [144x176].
  6. Like
    vitor got a reaction from thanasut in Watch List — Play and manage local media and streams   
    You misunderstood — you do it from Alfred’s file actions, not the Finder’s file menu. Select the files you want, and then press the keyboard shortcut (I think the default is Cmd+Opt+\).
  7. Like
    vitor got a reaction from deanishe in Download Media — Download video and audio from web pages   
    Usage

    Download video from a plethora of online sources via the dv keyword. Download audio with da. Your clipboard and frontmost browser tab are checked for links.


    ↩: Download. ⌘↩: Download full playlist. ⌥↩: Toggle adding to Watch List.
    Alternatively, download with the Universal Action.



    Check download progress via the dp keyword.


    ⌘↩: Restart download. ⌃↩: Cancel.
    ⤓ Install on the Alfred Gallery | Source
     
  8. Like
    vitor got a reaction from DJay in Download Media — Download video and audio from web pages   
    It by default downloads the best quality version available, so it will download different formats for different videos.
     
    That said, yes, it’s very easy to do what you want. On the workflow, double‐click the “Run Script” option, and replace the code with this one
    if [[ "{query}" == "addToWatchList" ]]; then watchlist="${HOME}/Library/Application Support/Alfred 2/Workflow Data/com.vitorgalvao.alfred.watchlist/watchlist.txt" filename=$(python youtube-dl -f 22/18/17 -o "${HOME}/Downloads/%(title)s.%(ext)s" --get-filename "$(pbpaste)") python youtube-dl -f 22/18/17 -o "${HOME}/Downloads/%(title)s.%(ext)s" "$(pbpaste)" echo "${filename}" >> "${watchlist}" echo "Done." else python youtube-dl -f 22/18/17 -o "${HOME}/Desktop/%(title)s.%(ext)s" "$(pbpaste)" echo "Done." fi The solution is the -f 22/18/17 option, which will download the best version available of either mp4 [720x1280], mp4 [360x640], or mp4 [144x176].
  9. Like
    vitor got a reaction from Moses in PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark   
    This is a very long reply to the previous two comments, specially the last one, so keep that in mind.
    Thank you for your comments. I’ll actually be releasing an update probably later today (it’s finished, I’ll just add some comments to the code) that changes the way the workflow operates. The thing you’ll notice most is that it’s way faster — as soon as you press return on the workflow, you can close the tab. There are also some interface changes, but I’ll explain everything in a later post.
    I very much appreciate your suggestions, but there are reasons as to why I chose to make it work this way. It’ll never be ideal to everyone and tradeoffs have to be made all the time. The fact is Alfred workflows, as great as they are, have several limitations. For example (not applicable to this workflow, but to others I have made), if you want to make a file action that will then receive input, you have to resort to tricks like saving the files’ location, and then calling Alfred via applescript with some text written, that’ll allow you to continue the action. That’s hacky, but it’s also currently the best way to do it right now. Also, if you try to build a workflow, you’ll notice not every module connects to every other, and you can’t chain two of the same “level” together.
    Regarding selected text as description, there are some immediate barriers I see. One is that since this is not a native app, I don’t have easy access to those kinds of OS‐features. I could maybe do that with applescript, which is a pain, by telling the browser to activate, and then asking the system to get the selected text. But the way this works, you do not need to have the browser as the frontmost window to add bookmarks, which is useful to the way I work (it’s a niche feature, granted), and by using applescript that could be hindred. Going back to the limitations in Alfred, there are ways it could be done by calling another option, but those are, again, hacky ways that could bring a worse experience to people (like me) who do not use descriptions. However, I’m already thinking of ways to add them at the same time as tags, maybe by enclosing them in certain characters (like {{}}).
    Regarding tag auto‐completion, you’re correct, it could be very slow (delibar, if I recall correctly, gets tags from other users as well), but I do think it’s a useful feature, and I’ll look into it. My main issue with it is I’m not sure it can be done right now in Alfred, specially since I’m using bash, and not something that would possibly be more geared towards this, like php.
    I also used Delibar (and still have a license for it), but I very much dislike bookmarklets, and extensions I cannot hide and still remain functional. I want my browser to look clean and non‐distracting at all times, and if a piece of software can’t do that, I usually shelve it. What that means is that I had the delibar app setup with the keyboard shortcut, but I needed the app so sparingly that I was constantly finding myself having to wait for it to open just to add a simple bookmark, which soon became boring, which is why I set out to do it another way. I spend so much time in Alfred, that this seemed like the right decision (and I still think it is).
    Also bear in mind this workflow is a script that works on top of another app, it’s made and maintained by a single person, who is not a developer full‐time, in his spare time, among other workflows, to scratch a personal itch, whose source is given for free without any kind of strings attached, and is less than one month old. While delibar is, well, I don’t think I need to continue. My point is, when you mention that features are “just being added or not available”, please let it breathe, it barely even had time to exist, let alone improve.
    When Martin says “way better to add bookmarks like this than with a bookmarklet, imo”, I take that as “to me, for the way I use and like to add bookmarks to pinboard, this is a better way, as it is more in line with the way I prefer to do it”, and that is what I feel. I use this to add bookmarks, and I see them (also via Alfred) by doing “!pb <something_to_search>“, as I have duckduckgo as my search engine.
    Please understand that I’ve built this workflow primarily for myself, for my needs. That is not to say I’m not open to suggestion and contributions, I very much am, and you can even modify this to your liking in any way you want (see the license). However, every bit of polish I’ve added (and in total I’ve spent more time on this than on core functionality), has been for you, the other users. What this entails is that every time I want to make a change, I think both about what works best for me, and what can be added that will not break the experience of the people that already like it the way it works right now.
    Pinboard is a very popular service amongst people that have skills to build apps to work with it, so it’s natural there are so many. If you see this as a workflow for people who like Pinboard, then it’s not for you, because this is a workflow for people who like Alfred.
    I hope this clarifies why those features have not (yet?) been implemented. Some of them depend on Alfred adding specific features, others depend on my time/mood/interest, and still others depend on its overall goal. Bottom line is this workflow isn’t for everyone, nor does it want to be, it’s supposed to be a lightweight, fast workflow for people that sometimes add bookmarks, and need to do it fast, it’s not a tool for people who add every site they visit, or need every feature under the sun — not only is that not feasible with Alfred without some (possibly major) downsides, like compromising on speed, it’s also not the goal of the project, at least right now.
  10. Like
    vitor got a reaction from drking in PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark   
    There is now.
    Update to the latest version and set you browser as “depends” — that’ll use the browser that is you frontmost app, if any, at the time you call PinAdd to add a bookmark. Keep in mind that only the same browsers are supported, and that since from the way this works it’s not possible to interrupt Alfred in case your frontmost app is not a supported browser, you’ll still get the “Operation done” message, but no bookmark will be added.
  11. Like
    vitor got a reaction from shrop in Hiding terminal when using a terminal command   
    I’m not sure that’s what he wants, as he said he already has a workflow. That is to run regular commands outside of them.
     
     
    What exactly are you trying to do? Workflows have a “Run Script” option (two, actually, under Actions and Outputs), you don’t need to make the terminal open.
  12. Like
    vitor got a reaction from Tyler Eich in “Keyword filter” or “keyword conditional”   
    There are many workflows that need configuring before being used (mainly the ones that need some type of account login/setting). However, there's no practical way of implementing that via Alfred. I find making users edit settings manually or having a separate option that'll always show in the results, for an action you typically only run once, to be non-optimal experiences.

    For this purpose, I have two workflows that employ a script filter, that does something like this
    if (settings_file_exists) show xml with text — “configure your account” arg — <some_string_to_let_the_script_know_it_is_a_configuration> {query} else show xml with text — “do your action” arg — {query} Even though this works well with DownVid, since only the configuration is needed (the else part takes no input); with PinAdd, not so much.

    The problem here is that since PinAdd takes {query} as the xml’s arg, if your computer is slow at the moment or you type too fast and then press return, Alfred will act immediately, without waiting for the xml to rebuild/re‐output with the updated {query}. Realistically, I only need the xml to build once, and then take the full, correct, untruncated {query} as the argument, where requested.

    Perhaps script filters aren’t build around this idea, but there is clearly a need for it, as currently you only get one of the worlds — either you can show different options depending on the case but you can’t really type some action to be passed through (script filters), or you can get the action perfectly but without having options (keyword input).

    My suggestion is then, perhaps instead of creating more options in script filters for specific cases, maybe create a separate category like “keyword filter” or “keyword conditional” or some better name. What this would do is allow you to specify some code to run as soon as you enter its name (much like script filters do), but this code would run only once, outputting some predefined xml, and would take a full argument passed through, much like the keyword input.
  13. Like
    vitor got a reaction from bikeNik in Download Media — Download video and audio from web pages   
    Usage

    Download video from a plethora of online sources via the dv keyword. Download audio with da. Your clipboard and frontmost browser tab are checked for links.


    ↩: Download. ⌘↩: Download full playlist. ⌥↩: Toggle adding to Watch List.
    Alternatively, download with the Universal Action.



    Check download progress via the dp keyword.


    ⌘↩: Restart download. ⌃↩: Cancel.
    ⤓ Install on the Alfred Gallery | Source
     
  14. Like
    vitor got a reaction from drking in PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark   
    Thank you, that is what I intended, glad to see it’s working fast for you.
  15. Like
    vitor got a reaction from drking in PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark   
    So, this is a huge update to how PinAdd works. If you just want to know how it works now, read the top post, as I’ve updated it. If you want to know a bit more of the differences, read on.
    The first thing you’ll notice is speed. Those of you who thought it was already fast, are in for a treat; if you thought it was slow, you’ll like to know it now feels pretty much instantaneous, even on slow connections. For the ones interested in knowing how that was achieved, I’ll explain it at the end.
    Another thing you’ll notice is that now it always shows you the options for adding a bookmark, and adding a boomark as private (if you have your Pinboard account set to always add as private, both will work the same). No more pressing “alt” to add as private, and since Alfred learns and prioritizes what you use more, I think it’ll be a more pleasant way to do it, for those of you who add a lot of private bookmarks.
    You probably won’t notice, those of you who have it already set up, but pressing “shift” to input your settings is no longer present. I always felt that needed some work, as even I constantly forgot to do it (I reset my settings a lot, for testing purposes). What it does now, is it first checks to see if you have it already setup — if you don’t, it’ll let you do that, if you do, it just switchs to bookmark adding. If, however, you want to delete your settings, run “pin resetpinaddsettings”, and it’ll delete them (it’s intentionally descriptive and verbose, so you won’t do it by mistake).
    If you want to know how the speed improvements were acheived, continue reading, otherwise, you may stop now.
    To explain how the new way is different, I’ll first have to explain how it worked before. When you typed “pin”, the workflow would just wait for you to finish typing your tags, and after you pressed “return”, it’d run a script that would do something like
    1. Read your settings (browser and token)
    2. Run the applescript to get your browser’s tab title and url, storing them
    3. Set your tags
    4. Access the Pinboard API, giving it the relevant information
    5. Output a notification
    Realistically, you could close your tab before getting the “added” notification (as soon as the second point finished), but there was no clear way to know when that was. If you did it before the second part ran, you’d be getting the wrong tab. However, I usually add a bookmark after I’ve gotten what I wanted from the page, so I’d like to add it, close the page, and be on my way. The way it worked, I had to wait for the notification, just to be sure.
    Now, it starts working as soon as you type “pin”, and it works something closer to
    1. Check if you’ve already configured it
    2. If not, show you the configuration options
    3. If yes, it’ll get you browser’s tab title and url, and add them to a temporary file
    4. After you’ve finished typing your tags and press “return”, it’ll both output a “done” message, and start running the rest of the script, that
    5. Reads your settings (browser and token)
    6. Sets your tags
    7. Accesses the Pinboard API, giving it the relevant information
    So in global terms, it’s not necessarily faster. It may even be slower. But it feels faster, and more importantly, it’ll actually let you go on to other things sooner, because now it’ll get all the information it needs from you beforehand, and it’ll be left to work after that. I believe this is a major improvement — even if you’re on a slow connection, after you see that “done” message you can go about your day, and it’ll just call Pinboard’s API in the background.
  16. Like
    vitor got a reaction from drking in PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark   
    This is a very long reply to the previous two comments, specially the last one, so keep that in mind.
    Thank you for your comments. I’ll actually be releasing an update probably later today (it’s finished, I’ll just add some comments to the code) that changes the way the workflow operates. The thing you’ll notice most is that it’s way faster — as soon as you press return on the workflow, you can close the tab. There are also some interface changes, but I’ll explain everything in a later post.
    I very much appreciate your suggestions, but there are reasons as to why I chose to make it work this way. It’ll never be ideal to everyone and tradeoffs have to be made all the time. The fact is Alfred workflows, as great as they are, have several limitations. For example (not applicable to this workflow, but to others I have made), if you want to make a file action that will then receive input, you have to resort to tricks like saving the files’ location, and then calling Alfred via applescript with some text written, that’ll allow you to continue the action. That’s hacky, but it’s also currently the best way to do it right now. Also, if you try to build a workflow, you’ll notice not every module connects to every other, and you can’t chain two of the same “level” together.
    Regarding selected text as description, there are some immediate barriers I see. One is that since this is not a native app, I don’t have easy access to those kinds of OS‐features. I could maybe do that with applescript, which is a pain, by telling the browser to activate, and then asking the system to get the selected text. But the way this works, you do not need to have the browser as the frontmost window to add bookmarks, which is useful to the way I work (it’s a niche feature, granted), and by using applescript that could be hindred. Going back to the limitations in Alfred, there are ways it could be done by calling another option, but those are, again, hacky ways that could bring a worse experience to people (like me) who do not use descriptions. However, I’m already thinking of ways to add them at the same time as tags, maybe by enclosing them in certain characters (like {{}}).
    Regarding tag auto‐completion, you’re correct, it could be very slow (delibar, if I recall correctly, gets tags from other users as well), but I do think it’s a useful feature, and I’ll look into it. My main issue with it is I’m not sure it can be done right now in Alfred, specially since I’m using bash, and not something that would possibly be more geared towards this, like php.
    I also used Delibar (and still have a license for it), but I very much dislike bookmarklets, and extensions I cannot hide and still remain functional. I want my browser to look clean and non‐distracting at all times, and if a piece of software can’t do that, I usually shelve it. What that means is that I had the delibar app setup with the keyboard shortcut, but I needed the app so sparingly that I was constantly finding myself having to wait for it to open just to add a simple bookmark, which soon became boring, which is why I set out to do it another way. I spend so much time in Alfred, that this seemed like the right decision (and I still think it is).
    Also bear in mind this workflow is a script that works on top of another app, it’s made and maintained by a single person, who is not a developer full‐time, in his spare time, among other workflows, to scratch a personal itch, whose source is given for free without any kind of strings attached, and is less than one month old. While delibar is, well, I don’t think I need to continue. My point is, when you mention that features are “just being added or not available”, please let it breathe, it barely even had time to exist, let alone improve.
    When Martin says “way better to add bookmarks like this than with a bookmarklet, imo”, I take that as “to me, for the way I use and like to add bookmarks to pinboard, this is a better way, as it is more in line with the way I prefer to do it”, and that is what I feel. I use this to add bookmarks, and I see them (also via Alfred) by doing “!pb <something_to_search>“, as I have duckduckgo as my search engine.
    Please understand that I’ve built this workflow primarily for myself, for my needs. That is not to say I’m not open to suggestion and contributions, I very much am, and you can even modify this to your liking in any way you want (see the license). However, every bit of polish I’ve added (and in total I’ve spent more time on this than on core functionality), has been for you, the other users. What this entails is that every time I want to make a change, I think both about what works best for me, and what can be added that will not break the experience of the people that already like it the way it works right now.
    Pinboard is a very popular service amongst people that have skills to build apps to work with it, so it’s natural there are so many. If you see this as a workflow for people who like Pinboard, then it’s not for you, because this is a workflow for people who like Alfred.
    I hope this clarifies why those features have not (yet?) been implemented. Some of them depend on Alfred adding specific features, others depend on my time/mood/interest, and still others depend on its overall goal. Bottom line is this workflow isn’t for everyone, nor does it want to be, it’s supposed to be a lightweight, fast workflow for people that sometimes add bookmarks, and need to do it fast, it’s not a tool for people who add every site they visit, or need every feature under the sun — not only is that not feasible with Alfred without some (possibly major) downsides, like compromising on speed, it’s also not the goal of the project, at least right now.
  17. Like
    vitor got a reaction from parekh in YOURLS URL shortening   
    Yes, it’s very simple with bash. There’s probably a way to do this using only applescript, but this also works.
    On the script, change the line
    property theURL : "" to be
    property theURL : (do shell script "pbpaste") then simply delete these lines
    tell application "Safari" set theURL to URL of current tab of window 1 end tell And it should work like you want.
  18. Like
    vitor got a reaction from drking in Mil   
    Here’s the theme I made for myself. Link shorteners cut my name (probably because of the “í” and “ã”), so that is why you’ll see “Unknown” in the name, but I think the important parts of the theme are there — if you notice anything different from the screenshot, please let me know.

    Download
  19. Like
    vitor got a reaction from vdesabou in Help making non‐volatile files from a workflow with bash   
    That’s it? That’s ridiculous(ly easy). This should really be somewhere more prominent. I don’t even need all the options of that script, I just made a prefsDirScript with
    #!/bin/bash bundleID=$(/usr/libexec/PlistBuddy -c "Print :bundleid" "info.plist") prefsDir="${HOME}/Library/Application Support/Alfred 2/Workflow Data/${bundleID}" if [[ ! -d "${prefsDir}" ]]; then mkdir "${prefsDir}" fi and I source that.Thank you for your help.
  20. Like
    vitor got a reaction from RevellNL in Github workflow   
    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


  21. Thanks
    vitor got a reaction from bivalvegruff in Label Colour Tag — Edit file labels and tags   
    Usage

    Edit labels or add and remove tags from files and folders via the Universal Actions.









    Alternatively, search for files and folders via the label, tag add, and tag del keywords or configure the Hotkeys.

    ⤓ Install on the Alfred Gallery | Source
     
  22. Like
    vitor got a reaction from RevellNL in Github workflow   
    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.
  23. Like
    vitor got a reaction from Sridhar Katakam in PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark   
    This workflow is officially deprecated in favour of PinPlus. 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.
     
    Before using this workflow, you need to configure it with your Pinboard account by running :configurepinadd followed by your api token and your preferred browser.



    You can get the API token of you Pinboard account by visiting https://pinboard.in/settings/password

    Your preferred browser may be one of Safari, Webkit, Chrome, ChromeCanary, Chromium, or depends (“depends” uses the browser you have as the frontmost window, provided it’s one of the mentioned ones).

    An example configuration would be: configurepinadd username:HSJWJK2HHSKI14QPDOIK safari
    When you’re all set, call pin followed by your tags and/or description — both are optional, and descriptions must be preceded by // (two forward slashes and a space). Pick if it should be added as a regular bookmark or as a private one (this is important, as it’ll trump your default options), and you’re done.



    The title of the bookmark will be the title of the page.

    You can also precede your tags with . (a single period), and it will add the bookmark as unread.



    There’s also a hotkey you can setup to quickly add bookmaks as unread (without any tags or description).
    If adding a bookmark fails for any reason (for example, if the connection drops), you’ll get a notification and a PinAddRetry.command file will be added to your Desktop (if it happens multiple times, it’ll add an entry for each failed attempt). You can double-click this file at a later time to run it, and retry adding the bookmarks.
  24. Like
    vitor got a reaction from drking in PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark   
    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.
  25. Like
    vitor got a reaction from paulw in PinAdd — Takes arguments as tags, and adds your browser’s frontmost tab as a pinboard bookmark   
    This workflow is officially deprecated in favour of PinPlus. 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.
     
    Before using this workflow, you need to configure it with your Pinboard account by running :configurepinadd followed by your api token and your preferred browser.



    You can get the API token of you Pinboard account by visiting https://pinboard.in/settings/password

    Your preferred browser may be one of Safari, Webkit, Chrome, ChromeCanary, Chromium, or depends (“depends” uses the browser you have as the frontmost window, provided it’s one of the mentioned ones).

    An example configuration would be: configurepinadd username:HSJWJK2HHSKI14QPDOIK safari
    When you’re all set, call pin followed by your tags and/or description — both are optional, and descriptions must be preceded by // (two forward slashes and a space). Pick if it should be added as a regular bookmark or as a private one (this is important, as it’ll trump your default options), and you’re done.



    The title of the bookmark will be the title of the page.

    You can also precede your tags with . (a single period), and it will add the bookmark as unread.



    There’s also a hotkey you can setup to quickly add bookmaks as unread (without any tags or description).
    If adding a bookmark fails for any reason (for example, if the connection drops), you’ll get a notification and a PinAddRetry.command file will be added to your Desktop (if it happens multiple times, it’ll add an entry for each failed attempt). You can double-click this file at a later time to run it, and retry adding the bookmarks.
×
×
  • Create New...