Dynamic Named Styles based on text or saved filter?

@unlocked2412

THANKS for this!

I downloaded and dragged the unzipped package into my OmniPlug-Ins folder on iCloud Drive.

Then I typed into the Console, getting this:

Also tried this, predictably getting:

How does one troubleshoot from here?

You’re welcome, @SGIII.

Not getting that error, here.

In any case, updated the PlugIn in this new link:

Does it work, now ?

Did you link another iCloud folder ? Are you using the default one provided by OO ?

@SGIII, I missed one step. These are the correct steps, I think.

To attach the handler to the current Outline, we should call onCellChanged method with the handler as the parameter and store it in a variable.

I would type (in the Console):

const redHandler = PlugIn.find("com.unlocked2412.conditionalFormatting").handler('redHighlighting')

Attaching the handler and returning a PlugIn.Handler.Registration

const registration = onCellChanged(redHandler)

To detach the handler, I would type (again, in the console):

registration.remove()

@unlocked2412

I can’t remember whether I’m using the default iCloud folder (mine is OmniPlug-Ins at the top level) but in any case it works now!

My goal is to apply colors to rows depending on values contained in the text of a target column, say the Cat column (which may have longer text than shown here, multiple words).

Will study this more later. Thanks so much!

1 Like

Hi Gabriel, could you share this file again?
Thanks and sorry for the trouble.

Hi, @Bernard-o. Sure. Per your request, I’ve just uploaded it to my repository.

1 Like

Thank you for the swift reply :)

Do you, or any of the others, notice the app slowing down when this is active? I just tested (it works!) but I notice a bit of lag in the text showing up in the screen as I type (probably because the app is checking for the string).

(On a M1 MBP)

@Bernard-o, I do not notice lag. See:

Thanks for the feedback. I unlinked a folder with other scripts/plugins and it improved after that. I had already had this problem in the past, when having a few plugins could cause the app to slowdown.

You might try checking the validation functions in those plug-ins to figure out where the issue is. I have quite a few plug-ins installed without any noticeable slowness, but all it takes is one slow validation function to slow down every interaction: plug-in actions appear in menus (and sometimes other places like toolbars), and menu validation happens with every input event. (I recommend limiting any validation to work that can be done in a small amount of constant time. Or just doing any needed validation when your action is actually getting called, rather than preemptively doing it within the plug-in’s validation function.)

1 Like

Thanks for the valuable input Ken. Could you please show dummy Plug-In code exemplifying those two suggestions ?

1 Like