Jump to content
luispedrofonseca

Sort resolution slices per folder

Recommended Posts

Hi guys,

 

with my current pipeline I'd like to be able to on exporting my slices (1x, 2x, 3x) a folder action would kick in and sort all my exported files to their respective folders.

 

Do you know any "easy" way to do this? I've been giving it a go with AppleScript but it's a pain to work with.

 

Cheers!


Personal website - http://www.luispedrofonseca.com

Follow me on Twitter - https://twitter.com/lpfonseca

Share this post


Link to post
Share on other sites

For anyone interested in the same thing (or similar) I ended up doing it as a shell script and it worked pretty great.

 

You can always do an Automator Service so you can trigger it with a right-click on the folder.

 

I'm sure there are easier/shorter ways to do it but this is working fine. :)

#!/bin/bash
# Creates folders to sort files exported by Affinity Designer
mkdir -p images
mkdir -p images/2x
mkdir -p images/3x

for file in ./*2x.png
do
	if [ -f "$file" ]
	then
		newName=$(basename ${file/@2x})
		mv $file images/2x/$newName
	fi
done

for file in ./*3x.png
do
	if [ -f "$file" ]
	then
  		newName=$(basename ${file/@3x})
  		mv $file images/3x/$newName
	fi
done

for file in ./*.png
do
	if [ -f "$file" ]
	then
  		mv $file images
	fi
done

Personal website - http://www.luispedrofonseca.com

Follow me on Twitter - https://twitter.com/lpfonseca

Share this post


Link to post
Share on other sites

We'll improve slice export soon to include a little more control.


SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×