Skip to content

Instantly share code, notes, and snippets.

@poritsky
Created December 8, 2012 22:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poritsky/4242230 to your computer and use it in GitHub Desktop.
Save poritsky/4242230 to your computer and use it in GitHub Desktop.
AppleScript to Run Brett Terpstra's Planter Without the Command Line
# 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