Jump to content

Font workflow - ideas


Recommended Posts

I'm wondering if it would be possible in Alfred 4 to write a workflow that would call a list filter or script filter which would display the text selection in various fonts, with an action to paste the reformatted text.

 

All of this is straightforward except changing the font.  I looked briefly at the arg/var object but it doesn't allow rtf transformations at this point.  I'm not really up for writing the raw rtf code to do this but wondering if there's a simpler way....

Link to comment
52 minutes ago, dfay said:

I'm not really up for writing the raw rtf code to do this

 

Write it in HTML and use textutil (builtin) to do it. That’s the method I’m using in MarkdownTransform.

 

This is a fun idea that might complement a Workflow I’ve been thinking about to manage fonts. In my case I’m focused on downloading/installation and removal.

Link to comment

I think I'm out of the loop here. You can use RTF in Alfred's results? And if so, how?

 

4 hours ago, vitor said:

Write it in HTML and use textutil (builtin)

 

This works pretty well. It sucks for inline text (as opposed to whole paragraphs), but it is a lot easier than messing around with raw RTF (which is how I had to do it in Zothero).

Link to comment
2 minutes ago, deanishe said:

I think I'm out of the loop here. You can use RTF in Alfred's results? And if so, how?

 

I don’t think you can, and I don’t see it happening anytime soon (or ever). I’d sooner expect an extra panel to display arbitrary info (à la Spotlight) than being able to change the text style on a per-line-result basis.

Link to comment
1 minute ago, vitor said:

I don’t think you can, and I don’t see it happening anytime soon (or ever).

 

Right. This is also what I've always assumed.

 

I think I misunderstood what @dfay is trying to do. I thought he wanted to preview the fonts in Alfred, not just output rich text formatted with that font.

 

Now that I've had a think about it, the problem I had with ZotHero that textutil always added a font face (I just wanted inline styles like bold and italics), so it was no good for pasting into existing text. That's not a problem here, though, seeing as changing the font face is the whole idea.

Link to comment
1 hour ago, deanishe said:

I think I misunderstood what @dfay is trying to do.

 

I don’t think so.

 

1 hour ago, deanishe said:

I thought he wanted to preview the fonts in Alfred, not just output rich text formatted with that font.

 

Pretty sure that’s it.

Link to comment

Yes, that's what I was hoping.  I looked at the snippet viewer and the snippet keyword results with an RTF snippet, and neither shows the formatting.

 

On 6/7/2019 at 10:34 AM, deanishe said:

In a Large Type? If so, you can use a JSON Config to change the font used.

 

Hmm I've tried this at your suggestion but am guessing in the dark as to the JSON to use - is it documented somewhere?

Link to comment

Well that lets me get the existing config

 

{
  "alfredworkflow" : {
    "config" : {
      "textcolor" : "",
      "backgroundcolor" : "",
      "largetypetext" : "{query}",
      "alignment" : 0,
      "fadespeed" : 50,
      "font" : "",
      "fillmode" : 1
    }
  }
}

But adding a JSON Config object before the Large Type object with a different value for font doesn't affect the result.

 

@Andrew is this expected behaviour?

Edited by dfay
Link to comment

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...