I was using Open File By Name before this. Up until now its behavior of
staying open when I selected files was something I found annoying, but this
time it's been useful.

Thanks for your assistance -- the script I came up with is entirely
shell-based:

#!/bin/zsh

if [[ $BB_DOC_PATH =~ "ruby" ]]; then

    bbedit ${BB_DOC_PATH/ruby/javascript} ${BB_DOC_PATH/ruby/python}

fi

if [[ $BB_DOC_PATH =~ "javascript" ]]; then

    bbedit ${BB_DOC_PATH/javascript/ruby} ${BB_DOC_PATH/javascript/python}

fi

if [[ $BB_DOC_PATH =~ "python" ]]; then

    bbedit ${BB_DOC_PATH/python/javascript} ${BB_DOC_PATH/python/ruby}

fi

This seems a little awkward to me -- and it's slower than I would have
expected -- but it works. I originally tried something that used things
like ${BB_DOC_PATH/ruby/**} to use the clever ** trick that you used and
I'd completely forgotten about, but it doesn't seem to work with the
script. (I tried escaping the asterisks with backslashes and putting the
argument in quotes, but neither one worked.)



On Tue, May 20, 2014 at 10:22 PM, Oliver Taylor <[email protected]> wrote:

> On 20 May 2014, at 5:31 PM, Watts Martin <[email protected]> wrote:
>
> What I'd like to do is have a script which will look at the current
> filename, and if it contains "/api/" then it will try to open the
> corresponding files
>
>
> BBEdit’s “Open File by Name” is very smart and helpful here. Simply
> searching for “not.md” should find all other instances in your directory
> tree. You can even shift-select to open multiple files.
>
> This shell script also does the trick: `bbedit
> ../../../api/**/math-and-logic/not.md`
>
> And, finally, this Applescript might be a good place to start (I’m not
> very great at applescript, so I combined it with shell stuff):
>
> *tell* *application* "BBEdit"
>
> *set* _file *to* (*file* *of* *the* *front* *window*) *as* *string*
> *set* _path *to* POSIX path *of* _file
>
> *if* _file *contains* "api" *then*
> *do shell script* "cd $(dirname " & _path & ") && /usr/local/bin/bbedit
> ../../../api/**/math-and-logic/not.md"
> *else*
> *return* *false*
> *end* *if*
> *end* *tell*
>
>
>  --
> 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].
>

-- 
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].

Reply via email to