Comments (14)
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.
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.
@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.
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.
Thank you so much, I will update as soon as possible and can't wait to try all this new stuff out :)
from keyboardcowboy.
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.
Is there some documentation for these magic variables?
from keyboardcowboy.
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.
Not that some of them only work for document application windows.
(I mainly use it for resolving from Xcode)
from keyboardcowboy.
@uwe-schwarz no worries, glad you figure out a workaround.
from keyboardcowboy.
@uwe-schwarz Here is another update, this is what it looks like right now.
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.
@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.
@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.
No worries mate ๐
Was just curious โค๏ธ
from keyboardcowboy.
Related Issues (20)
- open always a new window (iterm2) with hotkey not working HOT 9
- Key shadows stills on screen HOT 3
- Right Command Support HOT 1
- mouse doesn't work in workflow HOT 3
- Language agnostic keyboard shortcuts HOT 7
- Have a way to skip sending Keyboard shortcut to apps that use float windows (like Raycast/Alfred) HOT 4
- When launching a second time make it open the Configuration window HOT 5
- Using same key in combinations as sequence does not always work HOT 13
- Is there a way of backing up my data? HOT 2
- Make the configuration window remember its last position and size HOT 4
- Can not run Keybord Shortcuts that send F[1,2,3,4 ...] keys HOT 6
- Support for conditional Rebinding HOT 2
- Keyboard modifications not working every time I change audio device HOT 15
- Blank window HOT 8
- Documentation HOT 2
- Add support for Safari Web Apps HOT 1
- Applications quick peek and hide if active HOT 1
- Notification not showing full sequence for 3+ level
- Notifications not showing when active secondary (external) display
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keyboardcowboy.