Is it possible to create a workflow to copy an element from the web and paste it in other project?

I’m trying to achieve something similar to Relume, where I’ll be redesign some elements for Weweb, and then I want to have them display as a UI Kit so people can click “copy” and then go to their editor and paste it.

since we can use hot keys to copy/paste this might be possible. most likely its a JSON extrapolation of the element that is saved to your clipboard. during a copy event.

what i have to do on webflow is wait for a copy event, then paste the element so you can read whats in the clipboard, grabs it’s json text, then store that :wink:

similarly, to copy it back in im guessing that you can load the JSON into your clipboard as data, then paste it in the editor.

Check out my teams chrome extension Fam

That’s what I was thinking, I also found this Webflow tutorial but it’s not working and for some reason in Weweb when I copy the element display this error:

Hmmm,
i can give you access to a method to do that, but it’s a “hack” for internal tools, and may be change in the futur.
I am linking this topic to the product team to make it eventually more stable.

// Type can be 'wwObject' or 'section'
copy(type = "wwObject", uid) {
       const data = wwLib.$store.getters['websiteData/getFullWwObject'](uid)
        try {
            localStorage.setItem('wwCopy', JSON.stringify({ type, data }));
        } catch (error) {
            wwLib.wwLog.error(error);
        }
    }

After thinking, this will not work, because the localStorage will be set on a different domain.

1 Like

^^^you can also grab the code like this

3 Likes

Amazing thank you so much Jared!

Hey @jaredgibb ! Thanks for your helpful video. I tried your hack but it seems not working with classes. We have “Deleted classes” instead of the class created earlier (on the other account). Do you know how to do to copy/paste also classes?

If they can be copied it would be in a similar manner

Don’t think it can be copied… I’m wrong?

I’ve tried to hack this too, with local storage, but it is not quite a full blown solution yet. And you’d probably need an extension to change local storage for the less technical users.