Here is what I got to work, based on the included plugin AND on os x
10.7 (Lion)
-- PeepOpen support for BBEdit
-- Launches PeepOpen for either the current project directory,
-- first project file, or the current file.
set _theFile to missing value
tell application "BBEdit"
if (count of text windows) > 0 then
-- Get the first text window. This will return any window that
can
-- contain a text document (standalone window, project window,
etc.)
-- and skips over Find windows, Scratchpads, and whatnot
set _firstTextWindow to text window 1
if (class of _firstTextWindow is project window) then
set _projectDocument to project document of
_firstTextWindow
if (on disk of _projectDocument) then
set _theProjectDir to file of _projectDocument
tell application "Finder"
set _theFile to container of
_theProjectDir
end tell
else
-- Shipping versions of BBEdit don't provide
direct access
-- to the Instaproject root, so fake it by
asking for
-- the first node from the project list
set _theFile to item 1 of _projectDocument
end if
else if (class of _firstTextWindow is text window) then
if (on disk of document of _firstTextWindow) then
set _theFile to file of document of
_firstTextWindow
end if
end if
end if
end tell
if _theFile is equal to missing value then
-- No base file found for reference
-- Signal error by beep and end
beep
else
tell application "Finder"
-- To use this path as a hunk of a URL, we need to encode it.
-- Ask the Finder to give back a URL, and then extract the
-- salient text out of it
set _fullPath to POSIX path of _theFile
end tell
-- Construct the PeepOpen URL
set _peepOpenURL to "peepopen://" & _fullPath & "?editor=BBEdit"
-- Launch PeepOpen
open location _peepOpenURL
end if
On Jul 22, 1:48 am, Paul Grave <[email protected]> wrote:
> Thanks Jim,
>
> So what are the majority of BBEdit users doing? Do they navigate
> using the mouse to *quickly* find and open files?
>
> I like BBEdit, but lack of this feature is driving me nuts.
>
> On Jul 20, 2:33 pm, "Zajkowski, James" <[email protected]> wrote:
>
>
>
>
>
>
>
> > On Jul 20, 2011, at 6:15 AM, Paul Grave wrote:
>
> > > In Textmate, rather than navigate through folders, I'd type CMD+T and
> > > start typing the name of the file that I'm interested in, Textmate
> > > shows a list of matches and pressing enter would load the file. It's
> > > a super quick way for opening files. Is there a BBEdit equivalent?
>
> > The closest is cmd-D. It's not - IMHO - as fast or works as well as
> > TextMate or Sublime Text.
>
> > --Jim
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
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>