Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brandonpittman/5983193 to your computer and use it in GitHub Desktop.
Save brandonpittman/5983193 to your computer and use it in GitHub Desktop.
Rename_BBEdit_Document
tell application "System Events"
set new_name to text returned of (display dialog "Rename this file to..." default answer "" with title "Rename File" with icon POSIX file "/Applications/BBEdit.app/Contents/Resources/BBEditApplication.icns")
end tell
tell application "BBEdit"
set theFile to file of front document
end tell
tell application "Finder"
set ext to "." & name extension of file theFile
set name of file theFile to new_name & ext
end tell
tell application "BBEdit" to activate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment