Skip to content

Commit

Permalink
add objectID to image to make it unique
Browse files Browse the repository at this point in the history
  • Loading branch information
meticulous-dft committed Nov 3, 2017
1 parent 4b8b423 commit 3294fc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions sketch2app.sketchplugin/Contents/Sketch/library/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,15 @@ var l4c = {

processSlice: function(slice, document) {
var frame = [slice frame]
var sliceName = [slice name]
var objectID = [slice objectID]
var sliceName = encodeURIComponent([slice name])
var baseDir = helpers.getCurrentDirectory(document)

for (var i = 0; i < l4c.defs.factors.length; i++) {
var scale = l4c.defs.factors[i].scale
var suffix = l4c.defs.factors[i].suffix
var version = l4c.makeSliceAndResizeWithFactor(slice, scale)
var fileName = baseDir + "/" + l4c.defs.localFolder + "/images/" + sliceName + suffix + ".png"
var fileName = baseDir + "/" + l4c.defs.localFolder + "/images/" + sliceName + "-" + objectID + suffix + ".png"
[document saveArtboardOrSlice: version toFile: fileName]
log("Saved " + fileName)
}
Expand Down
2 changes: 1 addition & 1 deletion sketch2app.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Sketch2App",
"description": "A Sketch Plugin to upload mobile design and create native app instantly. Design in Sketch and view result on device in real time.",
"version": "0.4.0",
"version": "0.4.1",
"identifier": "instantapp.io.sketch2app",
"appcast": "https://api.sketchpacks.com/v1/plugins/instantapp.io.sketch2app/appcast",
"compatibleVersion": 3,
Expand Down

0 comments on commit 3294fc4

Please sign in to comment.