On 08/23/2018, at 10:21, TJ Luoma <[email protected] <mailto:[email protected]>> 
wrote:
> (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.


Hey TJ,

Something like this should do the job:

----------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2018/08/23 10:35
# dMod: 2018/08/23 10:35 
# Appl: BBEdit
# Task: Save modified on-disk documents.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @Save, @Modified, @On-Disk, @OnDisk, 
@Documents
----------------------------------------------------------------

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

----------------------------------------------------------------

NOTE – this has only had light testing.

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. 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>
--- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to