Giter VIP home page Giter VIP logo

Comments (14)

uwe-schwarz avatar uwe-schwarz commented on July 30, 2024 1

At least I have a workaround now, it's not perfect, but working.

First step "shell": date +%F | tr -d '\n' | pbcopy
Second step "text": $PASTEBOARD

Thanks for sharing the variables, this helped me a lot.

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024 1

Good news, started to investigate how hard this would be to pull off and I already have a POC working with output assignment.

Can share some more details later ๐Ÿ˜Ž

from keyboardcowboy.

uwe-schwarz avatar uwe-schwarz commented on July 30, 2024 1

@zenangst Thanks, I did know about groups, but I was just mumbling around and thinking of possibilities. I'm not sure what I (or someone else) could build with that. Remember, that I wanted basically only the current date on a shortcut :)

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024 1

Hey @uwe-schwarz, 3.24.0 just dropped with support for variable assignment :)
https://github.com/zenangst/KeyboardCowboy/releases/tag/3.24.0

from keyboardcowboy.

uwe-schwarz avatar uwe-schwarz commented on July 30, 2024 1

Thank you so much, I will update as soon as possible and can't wait to try all this new stuff out :)

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024

Hey @uwe-schwarz, there is already support for some "magic" variables that depend on your context but it would be awesome to pick up on variable assignment coming from the output of a shell script and use that later in the workflow. I really like this idea! ๐Ÿ‘

from keyboardcowboy.

uwe-schwarz avatar uwe-schwarz commented on July 30, 2024

Is there some documentation for these magic variables?

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024

Sadly no, I have yet to add them to the wiki.

But here they are:

    "CURRENT_WORKING_DIRECTORY"
    "DIRECTORY"
    "FILE"
    "FILEPATH"
    "FILENAME"
    "EXTENSION"
    "SELECTED_TEXT"
    "PASTEBOARD"

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024

Not that some of them only work for document application windows.
(I mainly use it for resolving from Xcode)

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024

@uwe-schwarz no worries, glad you figure out a workaround.

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024

@uwe-schwarz Here is another update, this is what it looks like right now.

image

So what we are seeing here is a workflow that runs ls in the current directory.
The current directory is resolved based on the current file (extracted from Xcode).
$DIRECTORY is one of the magic variables that you mentioned earlier.

I also added support for shebang inside both file and inline scripts.

The output of the ls command is stored inside the variable HELLO and can then be reused in other commands following that one. So if you run a series of commands and assign them to different variables, the final command will have access to all the variables that you have provided, which is pretty neat.

Note that assigning variables is only allowed in the workflow is configured with serial execution. Concurrent will just run all of them at the same time, which will result in variables not being set depending on the execution order. You can easily switch between them using the Concurrent/Serial menu in the workflow detail view.

I think this next update is gonna pack a real punch ๐ŸฅŠ when it comes to how much flexibility it gives to the user.

Hope this is what you were thinking @uwe-schwarz, and thanks for bringing this to my attention, I got really excited when I got it working and the potential for creating just insanely great workflows is from here to infinity ๐Ÿ˜Ž

from keyboardcowboy.

uwe-schwarz avatar uwe-schwarz commented on July 30, 2024

@zenangst Wow! Thatโ€™s exactly the flexibility I wanted, maybe even more. So far I only thought of simple output scripts, like date, but with this we can build multiple stuff within one workflow. I havenโ€™t fully grasped what this means finally, but it sounds really astonishing.

Could you maybe add the current window/application to the list of magic variables? I canโ€™t think of a good example, but probably someone will come up with a workflow which inserts different text depending on the window itโ€™s in.

Maybe like a signature in mail and it differs if you are writing the mail in Outlook vs. Mail, but with the same hotkey.

Iโ€™m really glad you got so excited about that and you got me too :)

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024

@uwe-schwarz What information about the current window or application would you like to add?

We already support having the same keyboard shortcut mean different things depending on the app. You can configure that on a Group. So a group can be constrained to one or more application.

You can read about groups in the wiki - https://github.com/zenangst/KeyboardCowboy/wiki/Groups

from keyboardcowboy.

zenangst avatar zenangst commented on July 30, 2024

No worries mate ๐Ÿ˜Ž
Was just curious โค๏ธ

from keyboardcowboy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.