Create Banner Image from Text Automator Workflow

Posted on
Fri Apr 29, 2016 2:33 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Create Banner Image from Text Automator Workflow

Here's the details https://macosxautomation.com/automator/ ... index.html

This has huge potential for control pages. But dang if I can figure out how to do it except as a service accepting selected text. Obviously the ideal would be to have Indigo kick it off and have it grab text out of either a variable, or a written plain text file.

Any ideas?

Image

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Fri Apr 29, 2016 3:40 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Create Banner Image from Text Automator Workflow

Create a workflow in Automator (after installing the component):

ss86.png
ss86.png (363.71 KiB) Viewed 4037 times


The script will pass the value of the variable to the "Create Banner Image from Text" component, which will then generate the image file. If you save that as an app from the Automator app, then you can create a trigger that fires whenever the variable changes with an "Open File" action. That will cause the image to be regenerated whenever the variable value changes.

Then you can use the image on a control page using the Refreshing URL image page element with "file://path/to/your/file.png" as the URL.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Apr 29, 2016 4:00 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Create Banner Image from Text Automator Workflow

Nice find, BTW. You can use this to show multi-line text on control pages. Just insert the multi-line text into an Indigo variable (that works fine) and then have this workflow generate an image for it. Cool!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Apr 30, 2016 8:08 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Create Banner Image from Text Automator Workflow

Awesome! Thanks for the missing part I needed. Figured there was a way to put an applescript at the start of it, but I discovered this at the end of the work day and didn't have a chance to poke at it.

And to be clear for others reading this who may be new: this facility is built in to every modern Mac! The Create Banner Image from Text workflow is already on your computer in Automator.

I see lots of other potential workflows as well.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sat Apr 30, 2016 11:31 am
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Create Banner Image from Text Automator Workflow

messing with this a bit, and one thing:

Tried saving this as an app as suggested, and it gets an unknown error when it runs. As a workflow it works.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sat Apr 30, 2016 1:47 pm
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Create Banner Image from Text Automator Workflow

Pretty cool find. The one thing that I don't see is a way to set the output image dimensions. Since the image dimensions would routinely change (probably), loading the image into a control page as a refreshing image URL wouldn't be possible because it would probably wind up distorted.

I'd recommend saving the image to the static images folder of the Indigo web server -- then Indigo would be able to handle the changing image size and it would look normal.

At least I'm pretty sure it would. :D

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Apr 30, 2016 2:28 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Create Banner Image from Text Automator Workflow

I'll have to generate a bunch of different banners and see if there's a default size coded in.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sat Apr 30, 2016 5:30 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Create Banner Image from Text Automator Workflow

Running as an app works for me.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Apr 30, 2016 6:53 pm
Different Computers offline
User avatar
Posts: 2533
Joined: Jan 02, 2016
Location: East Coast

Re: Create Banner Image from Text Automator Workflow

I'll try the app again.

The size of the banner varies based on the text. and it puts all the text on one line, so this may not actually be such a great fix for breaking lines or fitting text.

Unless someone knows a way to encode line breaks so the banner will honor them.

SmartThings refugee, so happy to be on Indigo. Monterey on a base M1 Mini w/Harmony Hub, Hue, DomoPad, Dynamic URL, Device Extensions, HomeKitLink, Grafana, Plex, uniFAP, Fantastic Weather, Nanoleaf, LED Simple Effects, Bond Home, Camect.

Posted on
Sat Apr 30, 2016 7:20 pm
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Create Banner Image from Text Automator Workflow

When I typed an Option-Return, it honored the line break. So I suspect that a '\n' in a string would also be honored.


Sent from my iPhone using Tapatalk

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 17 guests

cron