On Mar 22, 2012, at 18:19, fint82 wrote:
> I have a bbedit project created. That is great - I can see a bunch of related 
> files in one place - open up the few files I need to edit to make some 
> changes - all in the one fullscreen.
> 
> Say while making those changes I want to make some notes on a scrap file that 
> I save to /tmp or desktop. Right now when I create that new file it brings me 
> to a New Fullscreen window. I just want the new file
______________________________________________________________________

Hey There,

Appended is a script which will open a temp file into the front project window.

If the file does not exist it will be created.

The file is not added to the project, but you can easily drag it into the 
project file list from the 'Currently Open Documents' list if desired.

If you put the script in the BBEdit Script Menu and assign it a keyboard 
shortcut it will open the temp file in the currently frontmost space 
(full-screen-window).

If the file is already open in the project but not the active document it will 
become the active document.

This is very basic and could be customized quite a lot.

--
Best Regards,
Chris


------------------------------------------------------------------------------------------------
#       Author: Christopher Stone <[email protected]>
#      Created: 2012-03-23 : 15:37
#     Modified: 2012-03-23 : 15:37 
#  Application: BBEdit
#      Purpose: Open a temporary file into the front project window - creating 
the file if necessary.
# Dependencies: none
------------------------------------------------------------------------------------------------
on file_exists(hfsPath)
        try
                alias hfsPath
                true
        on error
                false
        end try
end file_exists
------------------------------------------------------------------------------------------------
try
        set tempFile to ("" & (path to desktop) & "BBEdit_Temp_File.txt")
        
        tell application "BBEdit"
                if my file_exists(tempFile) = false then
                        set newTempFile to make new text document in front 
project window initial save location tempFile
                        tell newTempFile to save
                else
                        if class of front window is project window then
                                open tempFile opening in front project window
                        else
                                open tempFile
                        end if
                end if
        end tell
        
on error eMsg number eNum
        set {c, s} to {return, "------------------------------------------"}
        set e to s & c & "Error: " & eMsg & c & s & c & "Error Number: " & eNum 
& c & s
        beep
        display dialog e
end try
------------------------------------------------------------------------------------------------

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

Reply via email to