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

Reply via email to