Skip to content

Conversation

@Arkkimaagi
Copy link

I prefer to have a separate page with all the interface elements that I have build. And a blank new page for the current interface where I use them. Syncing symbols from another page is annoying as you have to navigate to that page, find the correct symbol, hit cmd-e and navigate back to where you were.

What if instead you could hit cmd-alt-e and let Sketch find the first symbol with the same name and update the one you are working with automatically?

Well, this pull request does just that. It's a bit ugly and repeats the code (as there is no library file to use as of yet). But it gets the job done and shows the idea nicely.

What do you think?

@Arkkimaagi
Copy link
Author

So, if I got this right, it updates only the selected symbol with the data of first matching symbol (starting from top) from the first page (starting from top) that works. And then it stops.

@bomberstudios
Copy link
Contributor

This sounds wonderful! However, without even looking at the code, maybe you could use a specially named page? Say "Master Page", or something like that? That way, it would be easier to understand and the command could be named "Sync Symbols from Master Page", which (IMHO) makes a lot of sense : )

@tisho
Copy link
Owner

tisho commented Jan 14, 2014

@Arkkimaagi, can you help me understand your workflow a little bit better? Correct me if I'm getting this wrong:

So you create a symbol on the master page, let's say you name it something like "button : button-normal". Then you go to another page, create a new layer, then group it. Then you rename the group to something like "another button : button-normal" and you press Cmd+Alt+E to replace its contents with those of the first symbol instance in the document?

@Arkkimaagi
Copy link
Author

Tisho, yes, you got it just right. The real life use cases are a bit more complex, some time I want to change the symbol to something that's close to what it was.

Like:
I have on my "Master page" button, button-alert, button-preferred, and on my "Login mockup page" I have "Login:button".

Now let's image I decide to use two buttons instead of one and I want to make one of them blue as "preferred".

I just duplicate my button, rename it, and press cmd-alt-e to sync it up from where ever that symbol is defined first and I have one button as "button", and a copy of that changed to "button-preferred" with different styling.

Bomberstudios:
I was not able to get the name of the pages properly Sketch crashed on all my attempts and I did not find any example or documentation about getting the name. Also, my current code approach works even if you have the "Master page" as the last of your pages. It basically replaces the currently selected symbol with the first matching symbol from where ever it can find it. If you keep your symbols up to date with cmd-e, this should not be a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants