You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: The above assumes that the fileFormat suffix will NOT be appended to the name. So a fileName: "bob" exported as PNG would end up being called bob. The suffix/prefix in sketch should likewise NOT be included. So, if the user specifies that the exported file should have a @2x suffix through sketch's interface, the final filename should still bebob. This will afford developers full control over their exported filenames.
Expanded explanation
Currently export does not (appear to) allow you to supply a name for the exported asset. Exports are named after a combination of their layerName + their export size (but completely ignoring the user's settings for suffix/prefix). So, a layer named bob set to export as PNG at 2x and a prefix of what-about- would result in a file named [email protected] instead of the (to me, expected) what-about-bob.png (note that the later would match Sketch's inbuilt export behavior, whereas the former does not, which makes things inconsistent for the user).
In order to work around this I have to export the asset, reconstruct the name Sketch gave it (for instance, it tacks @2x on to the artboard name regardless of what I have set in sketch, which I take to be a bug), and then move the asset from that location to the location I want it to be at (in order to rename it to what I would like it to be named).
TL;DR: Allow user to provide name for file asset is to be exported to. Perhaps something like
fileName
:Note: The above assumes that the fileFormat suffix will NOT be appended to the name. So a
fileName: "bob"
exported as PNG would end up being calledbob
. The suffix/prefix in sketch should likewise NOT be included. So, if the user specifies that the exported file should have a@2x
suffix through sketch's interface, the final filename should still bebob
. This will afford developers full control over their exported filenames.Expanded explanation
Currently export does not (appear to) allow you to supply a name for the exported asset. Exports are named after a combination of their layerName + their export size (but completely ignoring the user's settings for suffix/prefix). So, a layer named
bob
set to export asPNG
at2x
and a prefix ofwhat-about-
would result in a file named[email protected]
instead of the (to me, expected)what-about-bob.png
(note that the later would match Sketch's inbuilt export behavior, whereas the former does not, which makes things inconsistent for the user).In order to work around this I have to export the asset, reconstruct the name Sketch gave it (for instance, it tacks @2x on to the artboard name regardless of what I have set in sketch, which I take to be a bug), and then move the asset from that location to the location I want it to be at (in order to rename it to what I would like it to be named).
Here's the code for that:
If this proposed change were implemented, I could instead just do:
The text was updated successfully, but these errors were encountered: