Skip to content

Updated plugin file writing to use NSString.writeToFile_atomically#3

Open
chriscohoat wants to merge 3 commits into
mathisonian:masterfrom
chriscohoat:master
Open

Updated plugin file writing to use NSString.writeToFile_atomically#3
chriscohoat wants to merge 3 commits into
mathisonian:masterfrom
chriscohoat:master

Conversation

@chriscohoat
Copy link
Copy Markdown

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