Last active
January 1, 2016 00:19
-
-
Save jgraup/8066160 to your computer and use it in GitHub Desktop.
Automator Workflow: Add service to right-click and run php file in Finder. Based on http://superuser.com/questions/373284/how-create-an-os-x-service-that-passes-a-files-path-to-a-shell-script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automator Service: Optimize Image files or folder | |
# Link: http://imageoptim.com/command-line.html | |
# Service receives selected (files or folders) | |
# in Finder.app | |
# Shell: /bin/sh | |
# Pass input: as arguments | |
open -a ImageOptim "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automator Service: Right-click to open or run php file | |
# Service receives selected (files or folders) | |
# in Finder.app | |
# Shell: /bin/sh | |
# Pass input: as arguments | |
# If file ends with .php then run it, | |
# otherwise just open the file | |
if [[ "$@" == *.php ]] | |
then | |
/usr/bin/php "$@" | |
else | |
open "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment