Automatically copy all PNG assets to the correct Android drawable folder. Very helpful when exporting assets with @?x
-suffix from, for example, Sketch and putting them into the correct folder without human interaction.
- Copy the AppleScript file to
~/Library/Workflows/Applications/Folder Actions
- Create a export folder where you'll put all exported PNGs
- Right click the folder, choose configure folder actions, check the "Enable folder actions" checkbox and attach the
android_assets.scpt
to your folder - Open the terminal and create a symbolic link by typing
ln -s /path/to/android-project/app/src/main/res /path/to/export-folder-you-just-created
Now just export PNGs into this folder with the suffix @1x
through @4x
and the script will copy them into the correct folder. For example icn_towel@1,5x.png
will be copied to drawable-hdpi/icn_towel.png
.
Hey @mac-cain13 !!
Could you look into exporting @1x assets without the actual suffix? Sketch isn't doing that by default, so it could save me lots of time :D