I have a BBEdit Text Factory that un/comments code in FileMaker custom functions. It was working fine 4 years ago when I last used FileMaker. However, it consistently fails now. I have demonstrated that the Text Factory works inside BBEdit. In Keyboard Maestro I have tried
switching between using the System Clipboard and a Named Clipboard
reselecting the Text Factory file from the KM action
renaming the Text Factory because the original file name had an ellipsis (…) in it
I have manually "Try"ed the Text Factory action, confirming the clipboard contents before and after invoking it, getting no change (no bracketing begin/end comment markers). Also confirmed that %ActionResult% is "OK".
I haven't seen any other postings about problems like this. Has any one else seen this? Should I file a bug report?
So nothing seems to have changed with the actions and the behaviour of BBEdit.
I would suggest you try that simple text factory and see if that works, and then if it does, try to figure out what is different about yours and why yours might not be working.
@peternlewis, I did try your example. Same behavior: I get unchanged text back from KM but can demonstrate it does correctly uppercase text in a BBEdit document.
I noticed that you placed your Text Factory directly under "BBEdit/", not "BBEdit/Text Filters/" where BBEdit expects them. BBEdit won't find it there to apply internally, but I did try it there using KM, and still no luck. I also tried booting in Safe Mode to see if anything else I'm running might interfere, but that also made no difference. And, I tried running it on text selection in a comment in the KM action to make sure invoking from FileMaker didn't have anything to do with it. I don't have time to further debug this right now, so I'll probably use @Nige_S's workaround for the moment.
I'm running Sonoma 14.7, KM 11.0.3, BBEdit 15.1.2 on a 16" M1 Pro MBPro (2021).
One last thing, what did you do to create the display of "Hello" "HELLO" that also has the KM icon?
@Nige_S, thanks for putting the effort into this example. I'm aware of and regularly use KM's regex capabilities, but for some more complex ones, I find it easier to construct and debug them in BBEdit. This may just be a personal preference, but it's clearly the workaround I need until I can get them working again from KM. I also use Text Factories for other things that can't be done in KM so easily.
BTW, the your test for whether to comment or uncomment needs to accommodate leading white space, among other things. It is also too aggressive on deletion of comment markers. FileMaker allows nested comments. Yours uncomments nested comments and also removes comment delimiters that appear inside quoted text.
I have a BBEdit Text Factory that un/comments code in FileMaker custom functions.
Hardly a comprehensive design statement...
It'll be much better to get your existing Text Factory to work rather than replicate it with KM actions. The best way to help people to help you is to post a minimal macro that demonstrates the problem -- since Peter's example also fails, post the macro you used for that.
You won't want to hear this, but... works fine here.
What I did have to do was give permission for KM to automate BBEdit. Check System Settings->Privacy & Security->Automation and make sure there's an entry for BBEdit in the Keyboard Maestro section and that it is turned on.
And when I turn that permission off the macro runs without error but seemingly does nothing, which would appear to be the behaviour you're seeing.
Not too surprising, given that it also worked for Peter.
It turns out that I did have to (re?)enable this. Who knows what specific security changes Apple has made during my FileMaker usage lapse.
Unfortunately, it still doesn't work for me. I also tried again in Safe Mode, so there are no obvious extra utilities interfering. Maybe it'll magically get fixed when I upgrade to Sequoia.
I did observe some strange behaviors, though.
When automate BBEdit is disabled, it still launches.
When I run my original un/comment macro, with automation enabled, BBEdit posts a notification that "Text Factory Completed"
When I run the uppercase macro, BBEdit does not post a notification
I clearly have more debugging work to do. I'll probably start with Bare Bones to see if there's any way to get some debug info out of BBEdit. This will have to wait, though. I'm running out of time on my FileMaker trial period, trying to figure out if I really want to fork over US$356 for upgrades on a recurring basis.