That was really helpful Chris, it occurred to me I completely forgot to try using a shortcut instead.
This gets me 90% of the way there (posting the small script for time travelers): tell application "BBEdit" to activate tell application "BBEdit" to tell document 1 to save tell application "System Events" to keystroke "k" using command down The ordering of the save seemed to cause a race condition, so this doesn't obviously meet the criteria of not saving if there's an error, but it certainly helps run it each save instead of me forgetting and giving me a nice big window. I bound the script to command + s and it all works great! -Brandon On Sun, Apr 14, 2019 at 1:53 PM Christopher Stone < [email protected]> wrote: > On 04/13/2019, at 15:28, Brandon Schneider <[email protected]> > wrote: > > Is the closest (and other variants) I've gotten, but the problem is the > menu is grayed out, so it's not really a functional script. > > ------------------------------ > > Hey Brandon, > > BBEdit cannot run UI-Scripts against itself. It chokes, although Rich has > apparently fixed the hang that used to occur. > > So your menu-click script won't work in this context. > > You'll have to call out to FastScripts > <https://www.red-sweater.com/fastscripts/> or Keyboard Maestro > <https://www.keyboardmaestro.com/main/> or something else to activate the > menu item. > > -- > 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 a topic in the > Google Groups "BBEdit Talk" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/bbedit/D5tO4hanw_A/unsubscribe. > To unsubscribe from this group and all its topics, 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. > -- 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 post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/bbedit.
