Re: Scripting in project documents/single windows

23 views
Skip to first unread message

Rich Siegel

unread,
Nov 9, 2012, 2:52:50 PM11/9/12
to bbe...@googlegroups.com
On Friday, November 9, 2012, David Schutz <manufr...@gmail.com>
wrote:

>We've upgraded a few BBEdit users to version 10. Now that BBEdit seems
>to put every document one opens into a single project and window, my
>scripts are breaking completely. Is there any way to tell BBEdit to
>make a particular document the active one (bring it to the "front"
>INSIDE a window/project) if you have its name, id, etc.?

The behavior is switchable; see the first item in the
Application preferences.

However, you're better off targeting documents, not windows, as
that approach will work irrespective of whether the user has
multiple documents in a window, or not. (And if you target
documents by name, you don't need to worry about whether they're
active or not.)

You can activate any window or document by using the "select" verb.

R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.

Rich Siegel

unread,
Nov 9, 2012, 3:54:48 PM11/9/12
to bbe...@googlegroups.com
On Friday, November 9, 2012, David Schutz
<manufr...@gmail.com> wrote:

>I have a difficult time getting our BBEdit users to change the
>behavior of their windows so I am trying to work with the
>application's defaults. i do target documents whenever i can,
>but i have had difficulty figuring out how to iterate through
>all the documents in a project, since "item" is not supported.

Consulting the scripting dictionary :-), you'll see:

project document n [inh. document > item] : a BBEdit
project document
elements
contains project items, project collections.

and

window n [inh. item] : an open window
elements
contains texts, documents; contained by application.

Projects don't contain documents, because projects are an
organizational construct on disk; however, the application
contains open documents, and each window (including project
windows) contains its own list of open documents as well.

But this is all guesswork, since I haven't seen your script nor
do I know what you're trying to accomplish.
Reply all
Reply to author
Forward
0 new messages