-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for contextual/environment arguments for script commands #45
Comments
it would also be great to get stuff like variables, for example $clipboardText, $activeDisplay and etc. |
Also got an idea, if you can add a blank key/any key in shortut and then use it as a variable I have a lot of text snippets mapped to keys - it would greatly improve the process of creating new one's |
@fushugaku, so you're saying 'blank key' means 'Any Key'? That means the last part of the sequence can be anything you want, right? |
yep, just any key at the end of sequence |
I like this idea, added it to my R&D list 🤓 |
Hey @fushugaku, I started tinkering with this feature and have a working prototype now. In this example, just like you described, ending the sequence with any key will trigger the workflow. The 'LAST_KEY' will be filled with the key you pressed. And if you have a rebinding, like 'shift+(' being a workflow that reassigns that key to another key press, then your rebinding will override the regular system event. (I have a bunch of rebindings when it comes to coding, which are specific to Xcode, Terminal, and other editors, so for me, that's really helpful). Based on the example you provided, you can use the same variable as shown in the screenshot to create a folder or file. |
Wow, that looks really cool, thank you! |
@fushugaku here is a pre-release if you want to take it for a spin 😎 |
@fushugaku I thought about that myself, that is why I added a button to the left of the recorder button. I should probably make that more visible to the user 😁 |
oh, I installed the wrong version %) |
Nice, let me know how it goes! |
I didn’t try this with pass through, perhaps that and the Any key is in conflict. Will need to investigate a bit. |
@fushugaku Found the issue, here is a new version. Keyboard Cowboy 3.25.5.dmg.zip Basically, I forgot to add these to the terminal environment. As you can see in my screenshot, I tested this with string interpolations with the type command. Totally forgot that there where to different codepaths. |
works as intended, thank you! |
@fushugaku Are you running the workflow as concurrent or sequential? |
But I am gonna look into why the number of keys in sequence might affect the outcome. |
Tried it with sequential - same result |
@fushugaku Yeah then there is something wonky with the keybinding and when to trigger the command. |
Hey @fushugaku, I've tried to replicate this and it works for me. Do you have any conflicting shortcuts? I've also attached a new version of the code. I made some additional changes to the source code, which might have fixed the issue. Let me know if it works for you! |
@fushugaku I'll take another look when life allows :) |
I think it would increase usability if arguments could be passed to shell scripts using environmental or contextual variables.
Example:
If we add support for passing of arguments, you could take it one step further and have one command produce output for the succeeding command(s). That could open up for command chains and ability to produce unique command type(s) that can take output.
Example:
The text was updated successfully, but these errors were encountered: