Jump to content

vitor

Staff
  • Posts

    8,980
  • Joined

  • Last visited

  • Days Won

    752

Posts posted by vitor

  1. What you can do is replace both the List Filter and Keyword Input with Script Filters.


    One way is to have each be a separate Script Filter: the second one writes its own arguments to a file and displays a single option to continue, like a Keyword Input. When you action it, it delete the file. Then the first one checks for the file’s existence, and if it does exist shows something for you to continue.


    A better way is to combine both into a single Script Filter, and have it interpret its own argument by using a certain character as breadcrumbs. Your Workflow can be collapsed into two objects: one Script Filter connected to one Large Type. That way, the History feature will get you your complete argument even if you dismissed Alfred’s search box. Here’s the Workflow’s code (Zsh):

    # If argument does NOT have a "→" in it, we are on the first step
    if [[ "${1}" != *'→'* ]]; then
     
      # Note how "Message" has:
      #   "valid":false which will make it so when you ↵, the Workflow won’t continue.
      #   "autocomplete" which will write that text into Alfred's box, making it a new argument
    cat <<JSON
        { "items": [
          {
            "title": "Message",
            "subtitle": "Create a new message to show in large text.",
            "autocomplete": "Message → ",
            "valid": false
          },
          {
            "title": "Message 1",
            "subtitle": "This shows \"Hello world!\" in large text.",
            "arg": "Hello world!"
          },
          {
            "title": "Message 2",
            "subtitle": "This shows \"Goodbye!\" in large text.",
            "arg": "Goodbye!"
          }
        ]}
    JSON
     
    else # We are on the second step
     
      # Remove all text from input until the last "→ " (note the space)
      # This is because we only care about that part of the text
      # This syntax is terse but there are many other more readable ways to do it
      # Particularly when using other languages
      readonly comment="${1#*→ }"
     
    cat <<JSON
        { "items": [
          {
            "title": "New Comment",
            "subtitle": "Enter new comment text",
            "arg": "${comment}"
          }
        ]}
    JSON
     
    fi
    
  2. I understand the process you’re chasing, but what is the goal? Your question is missing important context.

     

    macOS does not have the concept of cutting files, like Windows does. ⌘X won’t work, the correct shortcuts are ⌘C followed by ⌘⌥V. If you want to send keyboard shortcuts, Alfred has an object for that. But then how are you going to pick the correct file to copy and the correct place to paste? You seem to be entering the complicated and painful world of GUI automation, when you should instead be using the correct programmatic method: the Universal Action to move, or a simple mv command.

     

    Until you specify exactly what you’re trying to accomplish and why you think sending keyboard shortcuts is the solution (it very likely isn’t), it is impossible to help you better. Unless we understand the problem, we can’t provide the proper solution.

  3. Welcome @markus985,

     

    When asking about an existing Workflow, it’s best to use its own thread. Making a new thread, while it seems like it’ll give your problem visibility, fragments the discussion and makes it less likely the author and users of the workflow (the people who can help) will see it.

     

    I’ve moved your post into the correct thread.

     

    To answer your question, the Workflow does both. By default it opens in the Finder, but you can ⇧↵ to open on the web instead.

  4. Right, it’s exactly what @Vero said.

     

    @Foxy I apologise for having come across as rude to you. My intent was to be clear. I see your good intentions on providing more surface level information, but I wanted to be unambiguous that to give you a definitive answer we need deeper technical information.

     

    I have since thought of something you can try: Open File Action. But I don’t know if that’ll work. It depends on if Parallels makes macOS apps which invoke the Windows apps (I think it does or used to) and how those work in practice.

  5. 3 hours ago, Foxy said:

    Maybe there is a way to invoke that command using an Alfred workflow?


    And to do that, Parallels needs to support it. Nothing has changed from the first time I’ve pointed that out in the first reply.

     

    I don’t know why you’re resistant to getting the answer from Parallels, but until you do I cannot help you implement it.

  6. But can you even open that banks folder with Windows Explorer at all?

     

    5 hours ago, Foxy said:

    Do I still need to contact Parallels?


    Yes. Like I said:

     

    On 4/25/2022 at 2:13 PM, vitor said:

    For this to work at all, they have to provide some programatic way to allow it.


    I don’t use Parallels. I don’t know if they support that functionality and it’s their side which needs to. Unless there’s someone on this forum who uses Parallels and knows the answer (and sees this post), you’ll need to contact them (or search their documentation) to know.

  7. 4 hours ago, xilopaint said:

    As you can see I use echo to pass a newline to the next command where the binary k2pdfopt is executed. This is necessary because k2pdfopt is a CLI that waits for a newline to proceed

     

    That is, more likely than not, a “useless use of echo”. If you want to send a newline as input, then (as already mentioned) find a way to send STDIN to your command. But first make sure there really is no way to run the tool without interactivity.

     

    4 hours ago, xilopaint said:

     

    You’re not running multiple commands, you’re piping from one to another. Also, from that user’s specific example they shouldn’t be using the shell either. They should be running two processes sequentially, which is what the shell would do anyway.

×
×
  • Create New...