Help with plugin code structure/files

Hi, there’s a plugin I’ve been using a lot before that has stopped working in Sketch for a few version now. The plugin is Lippy (GitHub - abynim/lippy: An interactive lorem ipsum generator plugin for Sketch) and it’s to generate lorem ipsum text inside textfields in an automated way. I know there are other plugins, but I always found this was was more versatile and faster to use.

My question is, am I right to assume that the lippy binary in lippy.framework/ is probably where the code to fix would be, and the source code for that isn’t on github? And I’m out of luck without the developper’s help?

I’ve modified or ‘repaired’ other plugins before, I’m a designer with a basic comprehension of code and javascript, but it’s limited.

The plugin doesn’t seem to recognize that textfield is selected anymore. I’ve looked at the code, but the 2 javascript files I’ve found seemed more related to the randomisation of the output than the actual working of the plugin.

Thank you!

Hey Jean Francois,

Thanks for sharing this report. I took a look at the Github repo for Lippy and the framework files are compiled binaries. I’m not a developer, but it seems those are macOS executable binary files, so it’ll be expected that you only see the binary and no source for it.

Since you’ve already looked into the two Javascript files (script and markov) another option can be consulting with a macOS developer, they should be more familiar with those framework executable files and if looking into those could help solve the issue.

1 Like

Hey there,

Basically, what Jorge said: the actual source code of this plugin is not available on GitHub, so it’s not possible to simply fork it and make adjustments.

The good news is that, well, I know how to work around this particular limitation :sunglasses:

Please feel free to grab a patched version of the plugin from here: Lippy-patched-for-99-100.sketchplugin.zip - Google Drive – it should work with the latest Sketch 99.5 (and also Beta 100). Let me know if it doesn’t for some reason, we’ll figure it out.

Note: the plugin only works with text layers for now. I’ll add support for symbol overrides shortly – stay tuned.

4 Likes

Hello Dmitry!

Wow, thank you so much. You’re the best, that’s so great!

Works for me in 99.5. Now I just need to find a shortcut to assign it as cmd+L is now taken for layout.
I’ll probably go for control+i (for Ipsum, and seems unused)

Do you know if it’s possible to add items to the right-click contextual menu?

I know there’s a lot of stuff here already though.

That’s great for symbol overrides, looking forward.

Another thing would be with multiple textfields selected, and randomise between each. But might not be possible without the original code of the plugin.

My favorite part of this plugin was always how easy it is to select the length of the generated text, with line, multiline and paragraph. It works so well.

4 Likes

Whoa! This is amazing! Hats off to you Dmitry! :raised_hands: :pray:

And symbol overrides are coming, oh my! Huge shoutout and Thank You!

1 Like

A small update: I’ve added support for generating text in symbol overrides (so now the plugin is fully functioning just like it was before being abandoned by the author). Please check it out and let me know how it works.

Well it’s definitely possible, I recall there being a plugin that did something like this for arbitrary actions – can’t remember the name tho.

Do you mean that if multiple text layers are selected the plugin should just pick a random one and insert the generated text there? I guess I could make it work like this, yeah why not

Hi Dmitry,

Thanks for the update. Didn’t work initially, but I’ve restarted Sketch and installed v.100 and it is fine.

Only thing I can notice is that it works on the artboard, but not in the field in the Design panel. For me that’s a non-issue and I can’t remember if it used to work or not. I’m already so happy it works again!

No, I meant if there is multiple textfields selected, you show one Lippy UI, and it fills all the selected textfields with the chosen ‘length’.
The nice feature I was suggesting is that the text would be different for each textfield, like if I had run Lippy on each field separately.

1 Like

Ah, got it – I never knew it was supposed to work here, going to look into it tomorrow.

Hm, this will be more tricker to achieve but I’ll see what could be done! I’ve already started re-writing certain parts of the plugin so why stop here :sweat_smile: That’s a nice suggestion with multiple text fields receiving their own bits of random text.

Haha, thanks. Seriously, if you’d stop here, I’d be really happy already.

I’ve tried contacting the original developper on github through issues a while back, but never got an answer. Might be too late, but maybe it’s worth asking for the original code :stuck_out_tongue: But you seem well on your way to re-writing the whole thing :smile:

1 Like

Just a quick follow up on this Lippy business: I actually got in touch with the original developer and he was kind enough to share the plugin source code with me :tada:

Which means an official bugfix release for Lippy is out today – grab it from abynim/lippy or use an in-app update button in Sketch.

1 Like