Created
December 8, 2012 22:20
-
-
Save poritsky/4242230 to your computer and use it in GitHub Desktop.
AppleScript to Run Brett Terpstra's Planter Without the Command Line
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
# Easy Planter | |
# by Jonathan Poritsky http://candlerblog.com | |
# | |
# Run script to walk you through creating new file trees with Brett terpstra's Planter.rb | |
# For more info on Planter see Brett's original post: | |
# http://brettterpstra.com/planter-tree-planting-for-your-filesystem/ | |
# | |
# Note: Script does an mdfind to locate "planter.rb". If you've renamed planter then this will not work. Noted below how to change. | |
tell application "Finder" | |
set theFolder to choose folder with prompt "Choose Destination for Planter Make a New Folder Tree" | |
set theSoil to the quoted form of the POSIX path of theFolder | |
set theTemplates to (do shell script "ls ~/.planter | sed 's/.tpl//'") as string | |
set theList to paragraphs of theTemplates | |
set Plant to choose from list theList | |
set folderName to text returned of (display dialog "Enter Project Name" with title "Planter" default answer "") | |
--If you renamed Planter than change "planter.rb" in line below to whatever you called it. | |
set theScript to quoted form of (do shell script "mdfind -name planter.rb") | |
do shell script "cd " & theSoil & "&&" & " " & theScript & " " & Plant & " " & "\"" & folderName & "\"" | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment