a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

Example a-shell Shortcuts

Open nodecentral opened this issue 2 years ago • 2 comments

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?

nodecentral avatar Dec 02 '21 09:12 nodecentral

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.

holzschu avatar Dec 02 '21 10:12 holzschu

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?

nodecentral avatar Dec 02 '21 21:12 nodecentral

No, you can get the name of the file with Shortcuts, and then pass that to lua in a-Shell

Calorion avatar Oct 10 '22 20:10 Calorion