Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export fails when file has notes #505

Open
dannykeane opened this issue Oct 23, 2018 · 11 comments
Open

Export fails when file has notes #505

dannykeane opened this issue Oct 23, 2018 · 11 comments

Comments

@dannykeane
Copy link

notes-fail

Sketch v: 52.2
Measure v: 2.7.7

@erredos
Copy link

erredos commented Oct 25, 2018

I have the same problem it gets stuck when exporting notes.

@FabianRahm
Copy link

Can confirm on the newest versions - removing the note works and the export goes through fine.

@jackiewu
Copy link

jackiewu commented Nov 7, 2018

you can try editing
var textLayer = layer.children()[2];
to
var textLayer = layer.children()[3];

or waiting for new release

https://github.com/utom/sketch-measure/blob/master/Sketch%20Measure.sketchplugin/Contents/Sketch/library/common.js#L3104

@filamihsiao
Copy link

Please help to resolve this bug XD

@forestlin1212
Copy link
Contributor

you can try editing
var textLayer = layer.children()[2];
to
var textLayer = layer.children()[3];

or waiting for new release

https://github.com/utom/sketch-measure/blob/master/Sketch%20Measure.sketchplugin/Contents/Sketch/library/common.js#L3104

Not exactly.
Your method is only work for new notes, the notes which created by old version will failed.

The real reason of the bug is : the tree structure of note had been changed in new version 2.7.7
note v2.7.7 is
snip20181108_7

note old version is
snip20181108_8

I don't know how to resolve this in code yet. But we can change the structure of new notes manually. Just drag the "Rectangle" layer out of "note-box", then everything is fine.

@dannykeane @erredos @fr00x @filamihsiao

@jackiewu
Copy link

jackiewu commented Nov 8, 2018

Very thank you, I noticed it
So I edited my code early to find the exact TextLayer

the code / pull request: https://github.com/utom/sketch-measure/pull/516/files

var textLayer = layer.children()[2];
var _i = 2;
while (!(textLayer instanceof MSTextLayer) && layer.children()[++_i]) {
   textLayer = layer.children()[_i];
}
if (!(textLayer instanceof MSTextLayer)) {
   textLayer = this.addText({}); // add example text
}

I hope it can help.
And Not to modify sketch files or layers manually

@forestlin1212
Copy link
Contributor

Oh, yes, thank you. @jackiewu

@dannykeane
Copy link
Author

+1 @jackiewu you saved the day!

@Melody1127
Copy link

god。。。

@Melody1127
Copy link

How can i do? i have the same problem on exporting...cry~

@jackiewu
Copy link

If you don't mind, you can download our version to your plugins folder
sketch-measure.zip

or

You can clone this project to your plugins folder,
then edit the source code in [Sketch Measure.sketchplugin]
https://github.com/utom/sketch-measure/pull/516/files

or

Waiting for author release new version

Hope it can help you~

forestlin1212 pushed a commit to forestlin1212/sketch-measure that referenced this issue Nov 29, 2018
2.Change Artboard image format to jpg in export spec.
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

No branches or pull requests

7 participants