(I use this with Keyboard Maestro so that when BBEdit “deactivates”, the file will be saved. I have since learned that BBEdit has a feature to do this itself, but I've been using Keyboard Maestro for a long time, so I figured I'd stick with it.)The problems with this are two-fold:1. If the file has not been saved before, BBEdit will (understandably) bounce in the dock to tell me to name the file which it is trying to save. I would rather not bother trying to save as-yet-unsaved documents when BBEdit deactivates.2. Perhaps more significantly, this AppleScript only saves the front document, and I'd really much prefer that it do an “Save All”… but, again, only for files which can be saved without user-intervention.
if application "BBEdit" is running then
try
tell application "BBEdit"
set docList to (documents whose on disk is true and modified is true)
repeat with theDoc in docList
save theDoc
end repeat
end tell
end try
end if
I'm not sure why the 'try / end try' was there in my original Keyboard Maestro macros, but it doesn't seem to hurt, so I've left it here too.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"sup...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To post to this group, send email to bbe...@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.
On 8/23/18 at 2:06 PM, luo...@gmail.com (TJ Luoma) wrote:*set* docList *to* (*documents* *whose* on disk *is* *true* *and* modified
*is* *true*)
I recommend that you use "text documents" here, in order to avoid unintended consequences.