Sketch-Headers icon indicating copy to clipboard operation
Sketch-Headers copied to clipboard

cannot find function in MSPasteboardLayers at sketch v88.1

Open fendouxiaohaier opened this issue 2 years ago • 10 comments

how to use function setSymbols or setLocalSymbols in MSPasteboardLayers at sketch v88.1

fendouxiaohaier avatar Jun 08 '22 08:06 fendouxiaohaier

Sorry my export-headers script has stopped working since Sketch 83.1 and I haven't been able to find a solution. So I don't know the answer to this question.

abynim avatar Jun 09 '22 07:06 abynim

Thank you very much

fendouxiaohaier avatar Jun 09 '22 15:06 fendouxiaohaier

@abynim Could you please post the script you are using? Thanks

LeoNatan avatar Jun 28 '22 14:06 LeoNatan

@LeoNatan The script is here: https://github.com/abynim/sketch-headers-exporter

abynim avatar Jul 01 '22 04:07 abynim

@abynim Thanks, I will take a look soon.

LeoNatan avatar Jul 01 '22 14:07 LeoNatan

@abynim What isn't working for you with that script? I built class-dump from https://github.com/NSGod/class-dump, ran the commands you run to extract headers from frameworks, and it worked for the latest Sketch Beta. Perhaps the class-dump you are using is too outdated?

LeoNatan avatar Jul 03 '22 13:07 LeoNatan

Thanks for testing it @LeoNatan. That might be it. IIRC I could not get the latest class-dump to build, and didn't have time to dig deeper into it. Can you send me the class-dump build you generated and I can try to use that in the script? Please send to abynimbalkar at gmail if you're able to. Thanks!

abynim avatar Jul 04 '22 02:07 abynim

@abynim I just sent you my build. Let me know if it works or doesn't, so we can thing why it works for me locally but not for your workflow.

LeoNatan avatar Jul 04 '22 11:07 LeoNatan

I also devised a system that demangles Swift names in files, so that they appear as Sketch.UploadCollectionItem.h instead of _TtC6Sketch20UploadCollectionItem.h. Let me know if you are interested in integrating it in your flow.

LeoNatan avatar Jul 04 '22 11:07 LeoNatan

@fendouxiaohaier can use Object-C KVC example:

const pasteboardLayers = MSPasteboardLayers.new()
pasteboardLayers.setValue_forKey(symbols, 'localSymbols')

gaoshun avatar Jul 11 '22 10:07 gaoshun