Jump to content

vitor

Staff
  • Posts

    8,628
  • Joined

  • Last visited

  • Days Won

    719

Posts posted by vitor

  1. When reporting issues, please include your exact installed versions of:

    • The Workflow.
    • Alfred.
    • macOS.

    In addition to:

    • The debugger output. Perform the failing action, click “Copy” on the top right and paste it here.
    • Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.

    Thank you. Accurate and thorough information is crucial for a proper diagnosis which allows me to help you better.

  2. Thank you both. Your comments actually made me want to spend some more time implementing the rest of the functionality. After some work, it’s done (download link is the same). I’ve removed the “worthless” jokes, as they no longer apply since this is now actually playable. You still type “ping” to start a game, but this time you’ll pick a difficulty (“easy” makes it work as before).

    I also took the opportunity to try to and build a two-player (different) game, TurnShoot.

  3. Usage


    Remove UTM parameters, mobile subdomains, and other clutter from URLs via the Universal Action.


    ua.png


    Alternatively, configure the Hotkey to clean a selected URL or use the lc keyword to declutter the last copied URL.


    lc.png


    Redirects are followed before cleaning and the result is pasted to the frontmost app.


    ⤓ Install on the Alfred Gallery | Source

     

  4. Actually I think that is not utopic at all. Central repositories works very well for a lot of other projects, but that does not mean that every one *has* to use them.

     

    Exactly my point. Notice the repeated use of “any” and “every” on the original request and my reply.

    The original complaint stated

     

    (…) Not every workflow has been setup with this process.

     

    (…)there needs to be an accessible and user friendly central repository from which any user can browse, download and update any workflow or theme. (…)

    [emphasis mine]

    My argument is exactly that you cannot impose this on every case, for every workflow — that is utopic.

  5. even though I must say that security-wise, third party workflows will always be a problem.

    Again, this has been addressed on the thread I linked to.

     

    if you are able to run python/bash/etc, security is out the window. By not allowing installation hooks/scripts/etc, all you do is move the security concerns from installation, to runtime.. which doesn't seem to matter to me.

    It does matter. I (and I’m guessing others) tend to open up new workflows to see how they work, in search for interesting solutions; by doing this, it means we can find security issues and alert others without having our own machines compromised in the process. If the code runs at installation time, there’s no way to check it before running, and that is really bad.

    Third-party workflows will always be a problem, yes, but so is Alfred itself. The point here is that installation events can significantly increase security risks. In the balance between convenience and security concerns, the destructive powers of installation events that are run automatically without oversight is far greater than the convenience of not having to run one command once, after installation.

  6. As stated on the thread I linked to, having those kinds of events firing automatically is not exactly safe, so in that discussion, I’m for not having that possibility. Sure, we need an extra step for configurations, and although that’s a bit more annoying, it makes us take more care with the configuration process, and to help make it as clear and straightforward as possible.

    There are also more cases to take into consideration. For example, in the case of syncing, Alfred would have to keep track of what computers the install event already ran and those where it hasn’t, and act accordingly. And what if the install event does something the user doesn’t want to? There has to be a way to check for that. Specially in the case you mentioned, where you’re removing the traces of the action, there has to be a way to prevent malicious operations. One of Alfred’s strengths is that you have to specifically call the actions you want it to perform. Sure, you can still do it the way it currently works, but at least you can check for it, if you’re so inclined.

    All that said, I believe it’d be way more beneficial to have an install message — some configurable text that will appear to the user when installing the workflow, advising what the first command should be; something like the “Readme” section, but that appears as soon as the workflow file is opened for the first time.

  7. The last example you showed, FirePanther, looks like a great example of a good use case for a Script Filter — you’re searching for something, which means you will see results update and act on those (i.e., you need to first see them to decide to act on them, and the passed arguments are fully formed in those options), while on the “new file” example, what you write will have a direct influence in what command is output.

    Even though the question was not directed at me deanishe, when I need to do it, I usually do something like this

    -- with this method
    -- if a Finder window is open, it’ll return the path to the frontmost one, else it’ll return the path to the desktop
    tell application "Finder" to return (quoted form of POSIX path of (insertion location as alias))
    
    -- with this method
    -- if a Finder window is the frontmost window app, it’ll return the path of the frontmost one, else it’ll return the path to the home directory
    tell application "System Events"
    	if (name of first process whose frontmost is true) is "Finder" then
    		tell application "Finder" to return (POSIX path of (folder of the front window as alias))
    	else
    		return (POSIX path of (path to home folder))
    	end if
    end tell
    

    If I need the result in bash, or something like that, I do something like myDir=$(osascript -e '<the above code>'.

  8. I, for one, would be unlikely to use it for my workflows unless it required absolutely minimal effort to publish to: it's already more than enough work keeping my workflows updated on this forum, GitHub and Packal.

    Precisely. And even after publishing some editing is needed, as Packal links back to the forum thread, and in Github and the forum I link to the other two.

    Packal already uses github, so that part is covered anyway, but it uses it likely out of convenience. Having a single Github repo with all the workflows isn’t beneficial on its own, as downloads to workflows are useless in a vacuum — you need some context as to what they do and how they work.

  9. Similar requests have been made multiple times from multiple people, including me, at one point, and they’re still being discussed.

    However, for your particular case, why are you using a Script Filter to type a file name? Script filters are slow and inadequate for when you need to dynamically type an action that will be acted on depending on what you typed; they’re more geared towards retrieving and presenting information. I ran into that same wall with PinAdd, and had to change how the workflow works to get around that. This case is way simpler, though, why not use just a Keyword? It works well for this purpose.

  10. Going back to the original point of inserting ⇥, ↩, and others, it is fairly easy with applescript. Take into account, however, this will be like pressing the keys without any checking, so it can lead to undesirable results.

    As an example, if you want to fill your first name, press ⇥ to go to the next field, and fill in your last name, you could have a Run Script node using /usr/bin/osascript as the language, and write something like

    tell application "System Events"
      keystroke "<your_first_name>"
      key code 48
      keystroke "<your_last_name>"
    end tell
    

    key code 48 is ⇥, naturally. Something like Key Codes will help you find other codes you might need.

  11. You’re mixing a lot of different syntaxes and commands, using different approaches to do the same thing. You also have unnecessary elements for it to work as a workflow. It should work as you have it now, but if you want to make it cleaner and more maintainable, I suggest something like (without changing yours too much)

    alfin="{query}"
    
    idnum=$(echo "${alfin}" | cut -d ' ' -f1)
    descrip=$(echo "${alfin}" | cut -d ' ' -f2-)
    
    open "https://domain.com/subscription/sub?s&what=data&id=$idnum&note=$descrip"
    

     
    You might also have some trouble in the future, if your phrase ever uses a character that needs to be url encoded. For that to work, change the line descrip=$(echo "${alfin}" | cut -d ' ' -f2-) to descrip=$(echo "${alfin}" | cut -d ' ' -f2- | perl -MURI::Escape -wlne 'print uri_escape ($_)'). That last bit will take your characters and encode them so they can be used as part of a url.

  12. 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.

     

    Call bn with a website address and the Workflow will fetch the available logins with the corresponding success rate.


    If you had the login box selected prior to calling the Workflow, hit ↵ and it’ll automatically type the username, hit ⇥ and type the password. If for any reason that did not work or you just want one of the details, use ⌃↵ or ⌥↵ to copy the username or password (respectively) to your clipboard.


    EEFN1WS.gif

     

    Download | Source

  13. Using “.” is the correct syntax. However, if you really want to use “,” as a decimal separator, what you can do is change the same line mentioned above to input = float("{query}".replace(',','.')); this way “,” will be replaced by “.” when present, and the rest of the script can continue to function as usual.

×
×
  • Create New...