On Nov 18, 2014, at 18:35, Steve Samuels <[email protected]> wrote: > Why not create a new Project; the use the Add button (+) and select all the > files in the folders, but not the folders themselves. Unfortunately, this > doesn't seem to be scriptable.
______________________________________________________________________ Not scriptable? Create a synthetic project with the found file set: #! /usr/bin/env bash bbedit --project $(find ~/"test_directory/folders_nested/" -type f -not -iname ".DS_Store") Create a real project document with the found file set: ------------------------------------------------------------------------------------------- # Auth: Christopher Stone <[email protected]> # dCre: 2014/11/19 01:46 # dMod: 2014/11/19 02:00 # Appl: BBEdit & `find` # Task: Create a new Project Document with the found file set. # Tags: @Applescript, @Script, @BBEdit, @Project, @Find, @Files ------------------------------------------------------------------------------------------- set rootFolder to "~/test_directory/folders_nested/" set rootFolder to expandTilde(rootFolder) set newProjectFile to "~/Downloads/NUTS!.bbprojectd" set newProjectFile to expandTilde(newProjectFile) set shCMD to "find " & quoted form of rootFolder & " -type f -not -iname '.DS_Store'" set fileList to paragraphs of (do shell script shCMD) if fileList ≠ {} then tell application "BBEdit" # activate set newProjDoc to make new project document initial save location POSIX file newProjectFile tell newProjDoc repeat with i in fileList make new project item with properties {file:POSIX file i} end repeat end tell end tell end if ------------------------------------------------------------------------------------------- --» HANDLERS ------------------------------------------------------------------------------------------- on expandTilde(_path) if _path starts with "~/" then set _path to (POSIX path of (path to home folder as text)) & text 3 thru -1 of _path else error "Bad path string!" end if end expandTilde ------------------------------------------------------------------------------------------- -- Best Regards, Chris -- This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
