Hi Chris thanks for posting that. Very helpful. The only thing it
doesn't do is rename the file reference in the Project window.

So if I'm editing foo.html and I rename it with your script to new-
foo.html the file name changes (I can see it in Finder and at the top
of the BBEdit document) but the reference on the left stays as
foo.html

I've been poking around to see if that is automatable via the script
but I don't see that its possible.

- Eric



On Jul 27, 8:09 am, Christopher Stone <listmeis...@thestoneforge.com>
wrote:
> On Jul 21, 2011, at 07:47, Rob Claisse wrote:> Am I missing some thing 
> obvious but I can see how to rename a file in the project panel? I'd expect 
> to down click on a file and it allow you to rename it or atleast a option 
> when you right click but can see anything. Also a pain to have to keep going 
> back to the finder.
>
> ______________________________________________________________________
>
> Hey Rob,
>
> Some of your pain is pretty easily diminished.  Run this script via keyboard 
> shortcut from the BBEdit Scripts Menu to open a dialog for renaming the file 
> of the front text window.  Change the name, and it will rename the file in 
> the Finder.  You'll see this change reflected in the project file browser.
>
> --
> Best Regards,
> Chris
>
> ______________________________________________________________________
>
> # ccs
> # 2011-07-27 : 07:00
> try
>   tell application "BBEdit"
>     tell front text window
>       set docFile to its file
>       if docFile ≠ missing value then
>         set docFile to docFile as alias
>         set AppleScript's text item delimiters to ":"
>         set docFileName to last text item of (docFile as text)
>         set newDocFileName to text returned of ¬
>           (display dialog "Enter New File Name:" default answer docFileName)
>       else
>         beep
>         return
>       end if
>     end tell
>   end tell
>
>   tell application "Finder"
>     set name of docFile to newDocFileName
>   end tell
>
> on error errMsg number errNum
>   set sep to "=============================="
>   set e to sep & return & "Error: " & errMsg & return & sep & return ¬
>     & "Error Number: " & errNum & return & sep
>   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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to