Jump to content

Alfred 4: Rich Text in workflow [Fixed 4.0.2 b1085]


naven87

Recommended Posts

I just started using the Rich Text capabilities and Alfred 4 within a workflow and I found the following issues.

  • Using the copy to clipboard if the format is rich text then the {var:varname} syntax does not replace with the variable, instead it adds "{var:varname}" to the clipboard.  Same information with setting as plain text does the variable substitution just fine
  • When you select rich text the text is which against a black background (dark mode?), which then is white so the resulting text is white , and if you want dark text you have to set it to black which isn't readable on the dark background.   

David

Link to comment
Share on other sites

This is probably an enhancement request, and I'm not sure if it's even possible, but can RTF format specify the attributes which need to be formatted and let the rest match where it's pasted?  I often need to generate some calculated text via workflow and then color code the text based on the values, but the font and font size needs to match whatever is the existing format where pasted.

Link to comment
Share on other sites

1 hour ago, naven87 said:

but can RTF format specify the attributes which need to be formatted and let the rest match where it's pasted?

 

Yes and no. That is possible to do with binary attributes like "bold" or "italic" because RTF has "start bold" and "stop bold" instructions.

 

But as I understand it, with things like font face/size/colour, you only have "start style" instructions. There's no corresponding "end style". So if you want to turn some words in the middle of your text green, you can't just say "stop green" at the end of it to go back to the previous colour. You can only specify a different colour to use instead of green.


So, in theory you can create rich text with no font styling of its own that will match the style of the text it's pasted into. But if you change the text colour anywhere in the text, there's no way to change it back to "unformatted". From that point on, all text must have a specific, defined colour. Same goes for font face and size.

 

Does that make sense?

 

(If you can live with bold/italics/superscript instead of different colours, cite and pasteboard.py in this workflow contain code for doing that, if that's any help to you.)

Edited by deanishe
Link to comment
Share on other sites

  • Andrew changed the title to Alfred 4: Rich Text in workflow [Fixed 4.0.2 b1085]

Just tested it, and although I can change the color to black in the dialog, and still see it.  When I paste, it is back to white, and if I re-open the workflow the text color is back to white...  I'm using Dark Mode, if that makes a difference.  

 

Update - I'm not sure if this was expected but it seems that I need to regenerate the workflow step which used RTF to get the updated but it works now.  Thanks.

Edited by naven87
Updated information
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...