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

Macro to move object in exact position


Recommended Posts

I tried to make a macro to put 10 photos (3x4cm) to a 4R template in the position shown below.

591091975_ask1.png.a94260ca06d0e3eeb05a9442b7f90927.png

the problem is that I've recorded the macros, and put the photos at the proper coordinates. but when the macro is executed, the result is messed up. not like the photo above 

it turns out that what is recorded in the macro is not the final position (coordinates) of the photo, but an offset from its original position. even though the initial position when dragging a photo from explorer to affinity is always different.

593488368_ask4.png.b79c68269a72766d07cee6f310ace079.png

Likewise with resizing photos, what is recorded is the percentage change in size, not the final size result.
but in my case the most important thing is the position / coordinates of the photo.

I tried to record macros using the snap assist with the guide lines, the result was still messy, even though on PS it worked fine

Any suggestion?

Edited by ugly mask
Link to comment
Share on other sites

Can you supply a sample finalised 4R document with the 10 (3x4cm) images in it, all placed at the exact position you want them in the document?

 

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Link to comment
Share on other sites

I clarify my steps

This is the result when I dragged those 10 photos from explorer to affinity. the coordinates / positions are always random, and I can't make the photos always have the same coordinates when dragging from explorer.

drag.png.7bfbcf2eafabfca1ccf5a783d26ff9d3.png

 

As I remember using PS, its position was always in the middle when I dragged files from explorer.

then I recorded the macros to the position as shown below. this is the final position I want

bener.png.a92d9bfa1c373a89f63a556045c72a65.png

these are the coordinates of the position I want, with the reference point in the upper left corner of the photo

1641036491_ask2.png.8831a4d368eec23db77b1db5f60d298e.png                           1324464171_ask3.png.180f6ce9c075eeeaed1ea786a022f803.png

when I redo to the position like the first image, and run the macro. the results are as I expected

but when I drag a new photos again, it will get a different position like the image 1 (drag.png). I find it difficult to place the photos in the same position as image 1. the results are as below

1249232562_dragagain.png.dc827c31d8a578088bd5b34974d408d6.png

and the result when I run the macro is like this

mess.png.6a48acde342fe134943ff6249e8406e0.png

Edited by ugly mask
Link to comment
Share on other sites

Try the attached macro on the supplied test document

The test document supplied has the images randomly added (as regards their position)

Images (3x4cm) can be anywhere on the page, or even the canvas

The layer stacking order determines into which position each picture goes

The macro installs via the layer panel

 

Template 3x4 10x.afmacros 4R-test-document.afphoto

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Link to comment
Share on other sites

Thank you for your help,

it works well on the test document you provide. although there is one layer that was missed (layer 2).ask5.png.e9e61d1d9c681e57ad8d6fbb3016842b.png

ask7.png.ba4f7530ecd0b14c6ca6d13ef41b4fe8.png

can you tell me what you did to the macro so i can build it myself?

There will be some photo combination templates that I have to make.

there is no way I always ask for help in forums for almost the same thing

 

 

ask6.png

Edited by ugly mask
Link to comment
Share on other sites

10 hours ago, ugly mask said:

it turns out that what is recorded in the macro is not the final position (coordinates) of the photo, but an offset from its original position. even though the initial position when dragging a photo from explorer to affinity is always different.

In order to ensure the offset is always what is required

First move image 1 to 0,0 (i.e. top left of document)

Using

Arrange > Align  left
Arrange > Align Top

Then position the image

Do the same for image 2 which will have a different position

Likewise, for the remaining 8 images

Since the first thing we do is move an image to a known reference position (0,0) it does not matter where they are initially placed in the document. All positioning information will always be from the known reference position of (0,0)

 

To save time I am currently using an automated AI to reply to some posts on this forum. If any of "my" posts are wrong or appear to be total b*ll*cks they are the ones generated by the AI. If correct they were probably mine. I apologise for any mistakes made by my AI - I'm sure it will improve with time.

Link to comment
Share on other sites

10 minutes ago, sbe said:

Where can I find that more detailed Transform-Panel?

In the Macro panel, click on the gear icon next to the step.

All 3 1.10.8, & all 3 V2.4.2 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
Affinity Photo 
1.10.8; Affinity Designer 1.108; & all 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

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.