Hey Nestor & Chris,

This might or might not be less convoluted than Chris’s suggestion:

1. Take a script like Chris’s that deletes end of line whitespace, and attach 
it to the Save menu command (see manual for how to attach).

2. In BBEdit prefs, un-check Text Files -> Strip Trailing whitespace.

3. Write a short Applescript that tells BBEdit to save the file. Assign a 
keyboard command to that script. I’d suggest a key combo similar to what you 
have for Save (default Command-S).

Now when you save normally, the attached script deletes eol white space, and 
using your alternative key combo, saving doesn’t invoke the script, so your 
white space is preserved.

  - Bruce 

_bruce__van_allen__santa_cruz_ca

> On Aug 1, 2019, at 8:57 AM, Christopher Stone <[email protected]> 
> wrote:
> 
>> On 08/01/2019, at 07:00, Nestor Aguilera <[email protected]> wrote:
>> … after applying the filter you sent me it seems that (a) the file is not 
>> saved, and (b) the trailing spaces **are** trimmed, which is exactly the 
>> opposite of what I want (save the file with whatever white trailing space it 
>> has).
>> 
>> What am I doing wrong?
> 
> 
> Hey Nestor,
> 
> Whups.  That's my fault.
> 
> Drat.
> 
> This setting is not available to AppleScript, so the only way I can think of 
> to accomplish the task is as follows.
> 
> Set up a “dummy” language setting that has trim trailing spaces turned OFF.
> 
> Then use AppleScript to:
> 
> - Switch from your given source language setting to the dummy setting.
> - Save the file.
> - Switch back to the original source language setting.
> - Maybe necessary to do a second save to keep the source language setting.
>     - Not sure without testing.
> 
> I think this is doable if a bit convoluted.
> 
> --
> Best Regards,
> Chris
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or need technical support, please email
> "[email protected]" rather than posting to the group.
> Follow @bbedit on Twitter: <https://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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/FED26650-1D45-4A9B-8E86-2DECF7DBA6A0%40suddenlink.net.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <https://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 view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/4B1A1894-A443-4126-8319-06DE0C815D4B%40cruzio.com.

Reply via email to