Skip to content

DavidAGInnovation/run-code-file-quick-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Run Code File Quick Action

macOS Automator Quick Action that runs selected code files from Finder in a new Terminal window.

The action supports executable files with a shebang and common script extensions:

  • .sh with bash
  • .py with python3
  • .js with node
  • .ts with npx ts-node
  • .rb with ruby
  • .php with php
  • .pl with perl
  • .lua with lua

Install

  1. Open Automator.
  2. Create a new Quick Action.
  3. Set the workflow to receive files or folders in Finder.
  4. Add Run Shell Script.
  5. Set Shell to /bin/zsh.
  6. Set Pass input to as arguments.
  7. Paste the contents of src/run-code-file.sh.
  8. Save it as Run Code File.

After saving, select a script in Finder, right-click it, then choose Quick Actions > Run Code File.

Notes

  • Files with a shebang are made executable with chmod +x and then run directly.
  • Files without a shebang are run according to their extension.
  • Unsupported extensions open Terminal and show a short unsupported-file message.
  • The required runtime must already be installed and available in your shell path.

License

MIT

About

macOS Automator Quick Action that runs selected code files from Finder in a new Terminal window.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages