a-shell
a-shell copied to clipboard
Example a-shell Shortcuts
Hi,
I was looking for an example Shortcuts and while I noticed one or two shared, thanks to those that posted them, as they are invaluable to get you started..
The example workflow I’m looking for is something that would allow me to select and share a .Lua file with a-shell for it to then run automatically and report its output - but i couldn’t find anything that did that exactly.
So far I’ve tried to follow the instructions on the readme, put file
but all that happens is that I select the file to share, but all that occurs is a-shell opens up at the command line prompt, nothing seems to be loaded/run .?
I’m hoping somebody out there has a working example that they can share?
Hi, "put file" will only create the file in a-Shell sandbox. You then need to add an action to call the following commands: "lua nameOfTheFile.lua > resultFile.txt", then "open shortcuts://" (the last one will get back to shortcuts after executing lua), then add a third action, "get file" to get the content of resultFile.txt.
Many thanks @holzschu
need to add an action to call the following commands: "lua nameOfTheFile.lua > resultFile.txt"
Does that mean I need to set up and know the target Lua file name in advance? Is there not a way for the file name to be passed automatically?
No, you can get the name of the file with Shortcuts, and then pass that to lua in a-Shell