Skip to main content
Adobe Photoshop Family

101 Messages

 • 

1.6K Points

Wed, Jun 29, 2016 3:37 PM

Problem creating folders from generator

Having a problem exporting icons to folders, and don't know if this is a bug or my syntax is wrong. 

I'm trying to write a script that will export all my ios assets to one folder, and all my Android assets to another folder (with subfolders). I'm almost there, but I'm getting an error for the iOS folder for the 1x graphic. See below:

default 300% ios/@3x + 200% ios/@2x + 100% ios/ + 300% android/drawable_xxhdpi/ + 200% android/drawable_xhdpi/ + 150% android/drawable_hdpi/ + 100% android/drawable_mdpi/
The error I'm getting is: "Duplicate default specification: ios/"

I notice if I change the file name for the 1x graphics. For example, I do "100% ios/@1x" then I don't get the error, but the 1x graphics need to just be the base file name and not have "@1x" in the name.

Is this is a known bug? Is there a workaround? Is my syntax incorrect?

Thanks!

Responses

Champion

 • 

625 Messages

 • 

14.6K Points

4 years ago

maybe try adding a "/" to the "ios/@2x" and others that don't end with a "/"?

101 Messages

 • 

1.6K Points

That adds a new folder with that name

101 Messages

 • 

1.6K Points

4 years ago

That adds additional folders with that name

Champion

 • 

625 Messages

 • 

14.6K Points

4 years ago

Ah, I am sorry, I see what you are trying to do now. I ran a test and it is the order in which you put the ios/ groups that makes the difference... try putting the 100% ios/ as the first grouping instead:
default 100% ios/ + 300% ios/@3x + 200% ios/@2x + 300% android/drawable_xxhdpi/ + 200% android/drawable_xhdpi/ + 150% android/drawable_hdpi/ + 100% android/drawable_mdpi/

101 Messages

 • 

1.6K Points

4 years ago

That did it thanks Max!

This is the final code for reference in case anyone else wants to use it. This will output all your densities (except for xxxhd) for Android, and 3 sizes for iOS.

Your PSD should contain a masked smart object of each layer you're exporting scaled below 33.3% (so it can be scaled up to 300% without losing quality):

default ios/, 200% ios/@2x, 300% ios/@3x, 300% android/drawable_xxhdpi/, 200% android/drawable_xhdpi/, 150% android/drawable_hdpi/, 100% android/drawable_mdpi/