Dan D. Posted October 24, 2022 Posted October 24, 2022 I had a task that hopefully can be done simply, but I'm not sure if this functionality exists. I am designing a custom deck of playing cards, with each of the four corners containing the card rank (1-15 in this case). As it stands, I am making each new card on a separate artboard, and manually adjusting each text object to reflect the next number in the series of cards. Furthermore, I have to make sure that each time I double-click on the appropriate text to edit, it does not move the text box and mess up the relative alignment. It can get tedious. Is there a way to just update all the numbers in the layout to increase by one, either when I duplicate the artboard, or via a shortcut afterwards? Quote
v_kyr Posted October 24, 2022 Posted October 24, 2022 1 hour ago, Dan D. said: I have to make sure that each time I double-click on the appropriate text to edit, it does not move the text box and mess up the relative alignment. It can get tedious. Lock the text layers in the layers panel, so the the text box can't accidently move. 1 hour ago, Dan D. said: Is there a way to just update all the numbers in the layout to increase by one, either when I duplicate the artboard, or via a shortcut afterwards? No, ADe doesn't have any scripting/automation, or macro facilities yet. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2
thomaso Posted October 24, 2022 Posted October 24, 2022 2 hours ago, Dan D. said: Is there a way to just update all the numbers in the layout to increase by one, either when I duplicate the artboard, Workaround via APub: Open the .afdesign in APub and place the card number as page number field. Back in AD it appears to work. Although AD doesn't offer the Fields panel to create it there it updates the number in further artboards. Below I cmd-drag-copy the artboard 2-3 and, alternatively, copy/paste the text frame only on an empty artboard 4. artboards with APub page number field.m4v Quote • MacBookPro Retina 15" | macOS 10.14.6 | Eizo 27" | Affinity V1 • iPad 10.Gen. | iOS 18.5. | Affinity V2.6
v_kyr Posted October 25, 2022 Posted October 25, 2022 Here's a way to generate a simple SVG based rect & text template via a python script. The SVG bounding box (bb) has to be adapted sized accordingly then, actually it's (the bb) setup statically for 3 rects as an example (... but could also be instead generated/resized dynamically on demand). - This sample will increment the text numbers for each looped through artboard-rect to create here then accordingly. from sys import argv, stdout, stderr def print_SVG_header(): print('<?xml version="1.0" encoding="UTF-8" standalone="no"?>') print('<svg width="100%" height="100%" viewBox="0 0 1024 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">') def print_artboards(number, artboard_x_shift): print('<g id="Artboard1' + str(number) + '" serif:id="Artboard' + str(number) + '">') print('<rect id="Artboard' + str(number) + '" x="' + str(artboard_x_shift) + '" y="0" width="300" height="500" style="fill:none;"/>') print('<text id="lo" x="' + str(6.9 + artboard_x_shift) + 'px" y="20px" style="font-family:\'ArialMT\', \'Arial\', sans-serif;font-size:14px;">' + str(number) +'</text>') print('<text id="ro" x="' + str(286 + artboard_x_shift) + 'px" y="20px" style="font-family:\'ArialMT\', \'Arial\', sans-serif;font-size:14px;">' + str(number) +'</text>') print('<text id="lu" x="' + str(6.9 + artboard_x_shift) + 'px" y="475px" style="font-family:\'ArialMT\', \'Arial\', sans-serif;font-size:14px;">' + str(number) +'</text>') print('<text id="ru" x="' + str(286 + artboard_x_shift) + 'px" y="475px" style="font-family:\'ArialMT\', \'Arial\', sans-serif;font-size:14px;">' + str(number) +'</text>') print('</g>') if __name__ == '__main__': if len(argv) < 2 or len(argv) > 2: stderr.write("\n") stderr.write("Usage: %s [ -h | --help ]\n" % argv[0]) stderr.write(" %s number-of-rects\n" % argv[0]) stderr.write("\n") exit(1) number_of_artboards = int(argv[1]) artboard_x_shift = 0 print_SVG_header() for number in range(1, number_of_artboards+1): print_artboards(number, artboard_x_shift) artboard_x_shift += 350 print('</svg>') card_artboards.py The above little CLI python script would be called like this inside a terminal/console in order to pipe it's console output into a named SVG file (since it usually prints out to stdout) ... --> python3 card_artboards.py 3 > test.svg ... the above call would then generate/create some SVG code like this then in "test.svg" ... <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg width="100%" height="100%" viewBox="0 0 1024 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"> <g id="Artboard11" serif:id="Artboard1"> <rect id="Artboard1" x="0" y="0" width="300" height="500" style="fill:none;"/> <text id="lo" x="6.9px" y="20px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">1</text> <text id="ro" x="286px" y="20px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">1</text> <text id="lu" x="6.9px" y="475px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">1</text> <text id="ru" x="286px" y="475px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">1</text> </g> <g id="Artboard12" serif:id="Artboard2"> <rect id="Artboard2" x="350" y="0" width="300" height="500" style="fill:none;"/> <text id="lo" x="356.9px" y="20px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">2</text> <text id="ro" x="636px" y="20px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">2</text> <text id="lu" x="356.9px" y="475px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">2</text> <text id="ru" x="636px" y="475px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">2</text> </g> <g id="Artboard13" serif:id="Artboard3"> <rect id="Artboard3" x="700" y="0" width="300" height="500" style="fill:none;"/> <text id="lo" x="706.9px" y="20px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">3</text> <text id="ro" x="986px" y="20px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">3</text> <text id="lu" x="706.9px" y="475px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">3</text> <text id="ru" x="986px" y="475px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:14px;">3</text> </g> </svg> The so created SVG file can then be opened in ADe. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2
Recommended Posts
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.