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

Updated plugin file writing to use NSString.writeToFile_atomically #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chriscohoat
Copy link

The line:

NSString.stringWithString(svgString).writeToFile_atomically_encoding_error(path, true, NSUTF8StringEncoding, nil)

Was giving me an an error. You can reproduce with something like the following:

var errorPtr = MOPointer.alloc().init();
var file = NSString.stringWithString(svgString).writeToFile_atomically_encoding_error(path, true, NSUTF8StringEncoding, nil);
print(str);
print(errorPtr.value())

My changes are the only way I can seem to get the SVG to write to my filesystem. I also added a helper method to save the file along-side the original SVG, which people may want if they want to retain the original version of the SVG.

Sketch version 55 and I'm on macOS Catalina (Version 10.15.3).

@chriscohoat chriscohoat mentioned this pull request Apr 26, 2020
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.

1 participant