Open zenangst opened 4 years ago
it would also be great to get stuff like variables, for example $clipboardText, $activeDisplay and etc. Maybe it would be great to have in-built text buffers, for example temp files where you could input-output data from and use their contents as variables. Stuff like this can already be done with some scripting and shortcuts, but it's a bit tedious
Also got an idea, if you can add a blank key/any key in shortut and then use it as a variable example - keybinding: fn+w+blank_key action: take the name of blank key, create a txt file with the name, like a.txt, paste clipboard to it, save file keybinding: fn+r+blank_key action: paste from this blank_key txt file
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 😎
tried it, how do i type in ANY in the shorcut?) $LAST_KEY works, but only for key that was pressed in the combination.
also a small bug - for example when i use this shortut it should be "a", but now it pastes "w"
@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 %) yep, can see it now, will replace my buffer read-write and return with results
Nice, let me know how it goes!
tried it like this, didn't work for me, looks like the file is not created for some reason Pasting last letter is okay, but I guess it doesn't work yet in terminal scripts
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!
found a bug :) this scenario doesn't work:
this does:
the only difference is that i have an extra key after first sequence
@fushugaku Are you running the workflow as concurrent or sequential?
To ensure order, it should use 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. I'll investigate and get back to you. Thanks again for reporting and beta testing ❤️
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!
Hi! Thank you, tried it, it worked one time with concurrent, but now I can't make it work (doesn't work with serial either), cmd+c shortcut for some reason is not triggered it but works in a shortcut without any key %)
When i remove any_key - works just fine, like here
@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: