Closed davidklaw closed 10 years ago
I think this is a great idea, but one of the reasons I used the named layer approach was for people who don't use artboards. Having used Sketch more now, I would guess that's a small number of people, but it should be pretty easy to support both.
I think having functions findPreviewArtboard
and findPreviewSlice
that look for each type of thing, then calling both of them in preview
would work. (completely untested)
function preview() {
var previewTarget = findPreviewArtboard() || findPreviewSlice();
if (previewTarget) {
writeAndOpenPreviewFile(previewTarget);
}
else {
[doc showMessage:"The Preview plugin requires Artboards or a slice named 'Preview'..."];
}
}
Could you work something like this into the change?
Actually it would probably make more sense to call the findPreviewSlice
first, which would allow the user to override if they are using artboards.
If you are using Skala Preview you are probably testing iOS design. Not sure about you guys but I use the iPhone and iPad artboards when designing for iOS.
@marcisme Sounds easy enough. I'll see if I can't update it this evening.
@jelias That's the case, we are using iOS art boards. What's nice about what @marcisme is suggesting is that it'll be backwards compatible and nobody will know the difference.
Closed by 01fe1029f89d9475ddcbf295c46a50d1dca891d1. Thanks again!
I know it's been a while since you've touched this project but I thought it would be nice to have and forked it. Presented here for discussion (I took some liberties with the README).