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

Need guidance for creating a macro to split screenshot into two images... left and right halves.


Recommended Posts

I purchased the entire Affinity suite when it was first released as a Beta. But I had been using Photoshop CS6 so long (and knew it so well) that I never made the effort to switch. Now that I'm on macOS Monterey, CS6 is no longer available. On PS, I used macros extensively and could create what I needed without even thinking about it. I'm confident that I will soon have the same comfort level with Affinity products. But this old dog needs some help in learning my new tricks!

My challenge at present is to take a full screenshot and turn it into two pages, one comprising the left half of the screen and the other comprising the left half of the screen. I'd do this for a number of similar screenshots and, when finished, I'd combined them into a PDF book. The process I used in PS was to crop the original to half the size (left side first), then save it with the same name, appending "_Lft" to the name. Then undo the crop and repeat for the right side, appending "_Rgt" to the name instead. Close the image  and continue to the next. I would either load all the screenshots at once and automate it to all, OR I would simply batch process through all full-size screenshots within a given folder.

For some reason, I'm having an issue getting my head around creating the process in Affinity Photo (age, most likely). Any assistance in regard to the best approach would be greatly appreciated.

Drifter

Link to comment
Share on other sites

Hi svDrifter.

I think you can do this a little faster in affinity photo. But first you need to install a macro which you will find at the end.

So, after taking your screenshot press Ctrl+Alt+Shit+N (New from clipboard).
Now you can run the macro.
If you check your layers you should see the 2 halves, _Lft and _Rgt.

LR.png.4e137fa43f2004aa58890db797d22b34.png

At this point, if you wish, you can rename your layers to a more suitable name.

Finaly export your layers using the export persona.
Affinity Photo: Exporting slices

Split Screenshot.afmacros

Link to comment
Share on other sites

Thank you... I'll give it a try.  I'll be surprised if Affinity Photo will do it faster than my current CS6 macros, but I hope you're right. The main advantage to CS6 right now is that I've used it for decades and don't even need to think about it when I create a macro. But once I get used to the major differences between the two platforms, I'm sure it will be easier!

Thank you for your reply and assistance. I'll let you know.

Drifter

PS: Before even starting to edit the screenshots, I rename all of them incrementally... from "1.png" to ###.png. By adding the "_Lft" and "_Rgt", I simply open ALL of the cropped images at the same time, and they naturally sort in proper order. I could use anything else as well, but this is convenient and easy to distinguish. If I only use a part of the screenshot and do not split left/right, then I simply save them with the same name (but in another folder, nonetheless).

Edited by svDrifter
Link to comment
Share on other sites

How in the heck do you tweak steps in a macro? (I can't even see the parameters of the steps.) 

How do you delete unused steps in finished macro?

Ho do you keep a macro loaded, so you don't need to recall it for every image?

Link to comment
Share on other sites

6 hours ago, svDrifter said:

How in the heck do you ...

The APh macro implementation has a bunch of limitations in terms of capabilities etc., it isn't by far comparable let's say to things like PS Actions here.

In order to get an overview what APh macros just offer and how to use certain things in macros see for example the following tutorials ...

Macro tuts

☛ 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

Link to comment
Share on other sites

17 hours ago, svDrifter said:

My challenge at present is to take a full screenshot and turn it into two pages

This is important.
The macro that i provided splits the screenshot in 2 halves without you having to crop.

11 hours ago, svDrifter said:

How in the heck do you tweak steps in a macro? (I can't even see the parameters of the steps.)

In Affinity Photo, there are some steps that you can tweak but not all of them.
For example, if you add a gaussian blur you can change the radius after you record your macro.
If you invert a selection that is not tweakable.

As for the parameters here is a description that i think will help.

slice1.png.f2c971e21989ee0808eadaf99ebcfc19.png

01) Rasterize: Layer > Rasterize & Trim
02) Duplicate: Layer > Duplicate Selection (Ctrl+J)
03) Procedural Texture: Filters > Colours > Procedural Texture
It will fill the duplicate layer half black/half white

procedural.png.30433f7c7d82f23763b54cc79c5b95d8.png

04) Select higlights: Select > Tonal Range > Select Higlights
It will make a selection of the white half
05) Delete
It will delete the layer half white/half black
06) Duplicate: (same as 02)
07) Set description: "Rgt"
It will rename the layer.
08) Invert Selection: Select > Invert Pixel Selection (Ctrl+Shift+I)
09) Set Current Selection
It will select the bottom layer
10) Duplicate: (same as 02)
11) Set description: "Lft"
12) Deselect: Select > Deselect (Ctrl+D)
13) Set Current Selection: (same as 09)
14) Delete
It will delete the bottom layer

 

Link to comment
Share on other sites

21 hours ago, svDrifter said:

My challenge at present is to take a full screenshot and turn it into two pages, one comprising the left half of the screen and the other comprising the left half of the screen. I'd do this for a number of similar screenshots and, when finished, I'd combined them into a PDF book. The process I used in PS was to crop the original to half the size (left side first), then save it with the same name, appending "_Lft" to the name. Then undo the crop and repeat for the right side, appending "_Rgt" to the name instead.

Honestly that is trivial to do and automate even further, without the need of Affinity at all, under MacOS! - To give you an idea, see the manpage for screencapture here (or perform "man screencapture" inside a MacOS terminal to show and read the man page there).

With "screencapture" you can automate the process without the need of cropping at all. So for example to take a screenshot of the whole screen/display you can perform:

  • >   screencapture -T 2 ~/myscreen-full.png
    -T seconds  Take the picture after a delay of seconds, default=5
                Handy for arranging windows/menus before taking the screenshot.

Now suppose your monitor/display/screen has a resolution of let's say 1920 x 1200 pixels, screencapture also has an option to define the rectangular area to capture the  screen via the ( -R x,y,w,h   Capture a screen rectangle, top,left,width,height ) then. - So now in order to get a screenshot just of the left and right sides of our 1920 x 1200 pixel monitor we need just to perform ...

  • >   screencapture -T 2 -R 0,0,960,1200  ~/myscreen_Lft.png
  • >   screencapture -T 2 -R 960,0,1920,1200  ~/myscreen_Rgt.png

... which creates the two left & right halve screen captures of the monitor for us. You see no cropping needed at all!

The above shown screencapture commands can be automated, aka made more comfortable via Apple's/MacOS Automator and/or AppleScript. So you could for example start the process like an app with an associated icon from the desktop, show up an Ok panel first which when pressed performs the two screencapture call executions, or show up two textpanels for naming the captures then dynamically etc. etc.

☛ 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

Link to comment
Share on other sites

22 hours ago, svDrifter said:

I purchased the entire Affinity suite when it was first released as a Beta.

===========

I assume the bolded left is a mistake and you meant the right half.....

21 hours ago, svDrifter said:

My challenge at present is to take a full screenshot and turn it into two pages, one comprising the left half of the screen and the other comprising the left half of the screen.

I would use Publisher and have a two page spread, put the entire screenshot on the two pages and you have the left half of the screenshot on the Left Page and the right half on the Right Page. Export as Pages, not Spreads and Bob's your uncle.

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

3 hours ago, Old Bruce said:

===========

I assume the bolded left is a mistake and you meant the right half.....

Yes, it was... thank you. (Aging eyes and running one's hand through a table saw indeed increases the likelihood of typos and other such errors. ;-)

Edited by svDrifter
Link to comment
Share on other sites

4 hours ago, v_kyr said:

Honestly that is trivial to do and automate even further, without the need of Affinity at all, under MacOS! - To give you an idea, see the manpage for screencapture here (or perform "man screencapture" inside a MacOS terminal to show and read the man page there).

With "screencapture" you can automate the process without the need of cropping at all. So for example to take a screenshot of the whole screen/display you can perform:

  • >   screencapture -T 2 ~/myscreen-full.png
    -T seconds  Take the picture after a delay of seconds, default=5
                Handy for arranging windows/menus before taking the screenshot.

Now suppose your monitor/display/screen has a resolution of let's say 1920 x 1200 pixels, screencapture also has an option to define the rectangular area to capture the  screen via the ( -R x,y,w,h   Capture a screen rectangle, top,left,width,height ) then. - So now in order to get a screenshot just of the left and right sides of our 1920 x 1200 pixel monitor we need just to perform ...

  • >   screencapture -T 2 -R 0,0,960,1200  ~/myscreen_Lft.png
  • >   screencapture -T 2 -R 960,0,1920,1200  ~/myscreen_Rgt.png

... which creates the two left & right halve screen captures of the monitor for us. You see no cropping needed at all!

The above shown screencapture commands can be automated, aka made more comfortable via Apple's/MacOS Automator and/or AppleScript. So you could for example start the process like an app with an associated icon from the desktop, show up an Ok panel first which when pressed performs the two screencapture call executions, or show up two textpanels for naming the captures then dynamically etc. etc.

Most interesting... thanks for the enlightenment! I automate the screenshot process with a "Keyboard Maestro" macro. One click and done. I had not, however, thought of restricting the screenshot to a definined area. Very slick. Old dog - new trick... I like it!

Thanks.

Link to comment
Share on other sites

28 minutes ago, svDrifter said:

I automate the screenshot process with a "Keyboard Maestro" macro

Even better, that's another powerful tool for all sort of automations here, it also can (re)use Automator/AppleScript etc. So it should be relatively easy to do with Keyboard Maestro to automate the two (left/right) screen area captures then with just one click.

☛ 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

Link to comment
Share on other sites

Allow me to thank each or you for your much appreciated assistance and gracious replies, to what must have seemed to be a really dumb question. I'm so glad I found this site and hope that I can contribute along the way. Admittedly, I never expected for this forum to be so incredibly helpful (and even humbling).

Thank you one and all.

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.