Last active
December 16, 2015 18:58
-
-
Save bytespider/5481240 to your computer and use it in GitHub Desktop.
Serve a folder with Python SimpleHTTPServer
This file contains 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
on run | |
tell application "Finder" | |
if selection is {} then | |
set finderSelection to quoted form of POSIX path of (folder of the front window as string) | |
else | |
set sel to (first item of (selection as list)) | |
if class of sel is folder then | |
set finderSelection to quoted form of POSIX path of (sel as string) | |
else | |
set finderSelection to quoted form of POSIX path of ((container of sel) as string) | |
end if | |
end if | |
end tell | |
tell application "Terminal" | |
activate | |
do script "cd " & finderSelection & "; python -m SimpleHTTPServer 8080;" | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment