Closed Elifro closed 7 years ago
I just installed and had the same issue. Fixed it by updating line 224 of script.cocoascript, from:
return colour;
to:
return colour.immutableModelObject();
I'm not a Cocoa/Mocha dev, so am not clear on what exactly changed in recent Sketch versions, but in debugging I found that the hexValue() method was undefined on the returned color object. (Even though that object was of class MSColor, and the Sketch docs show that class as having the hexValue() method...) I had a look at the source code for inVision's Craft plugin and found them using this immutableModelObject() method before calling hexValue(). Tried it here, and: Et voilà!
@lewishowles I will submit a pull request shortly.
That's the problem I'm having - the Sketch documentation is relatively horrendous and it seems they remove functions with every update.
I'd got as far as realising hexColor was the issue but couldn't find what was supposed to be done as like you say according to the documentation it should work.
Will have a look at the pull request shortly.
Cheers!
@lewishowles Glad my troubleshooting was of use. And btw, thanks much for the plugin! A couple hours of my time troubleshooting is still going to save me time overall on replacing colors through a massive sketch project I'm working on. :)
Just installed it, however I can't get it to work. Nothing happens when I select a fill layer and then click the replace colour btn.