Jump to content
You must now use your email address to sign in [click for more info] ×

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
Link to comment
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
Link to comment
Share on other sites

  • Staff

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.