Rename while in project panel

353 views
Skip to first unread message

Rob Claisse

unread,
Jul 21, 2011, 8:47:43 AM7/21/11
to BBEdit Talk
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.

Also is it possible to drag files and move then between folders in the
Project panel? It looks it should work but nothing gets moved?

Thanks

Paul Beardsell

unread,
Jul 22, 2011, 8:19:07 AM7/22/11
to BBEdit Talk
I can't see it either. Anyone have any clues?

Christopher Stone

unread,
Jul 27, 2011, 8:09:23 AM7/27/11
to bbe...@googlegroups.com
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

Eric Ishii Eckhardt

unread,
Jul 27, 2011, 3:33:00 PM7/27/11
to BBEdit Talk
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:

Matthew Schinckel

unread,
Jul 29, 2011, 8:05:49 PM7/29/11
to bbe...@googlegroups.com
I'm seeing that renaming using that script does change the filename in the Project tab, and everywhere else I could see in BBEdit.

I have upgraded to the 10.0.1 (3063) build, if that makes a difference.

Matt
Reply all
Reply to author
Forward
0 new messages