naven87 Posted June 5, 2019 Posted June 5, 2019 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
Andrew Posted June 6, 2019 Posted June 6, 2019 @naven87 Thanks for pointing these out, I'll get both sorted in the next build Cheers, Andrew naven87 1
naven87 Posted June 7, 2019 Author Posted June 7, 2019 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.
deanishe Posted June 7, 2019 Posted June 7, 2019 (edited) 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 June 7, 2019 by deanishe
Andrew Posted June 7, 2019 Posted June 7, 2019 In the 4.0.2 pre-release, Alfred should now mark almost black and almost white as macOS control text colour instead, which means it should match the paste behaviour
naven87 Posted June 10, 2019 Author Posted June 10, 2019 (edited) 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 June 18, 2019 by naven87 Updated information
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now