Modify default settings with Keyboard Maestro (or other) based on certain variables (such as screensize)

I am switching between two different setups and would like to adjust the default settings for PDF display accordingly:

  1. Macbook Pro 14" when I am working mobile.
  2. Macbook Pro 14" with stationary screen (much bigger resolution) as main display.

As a researcher I am using DTP mainly to read and annotate articles (PDF). Depending on my main screen and the screen size I am finding myself constantly switching between a Two Pages PDF layout (external screen) and Single Page PDF layout (internal screen). I would love to automate the switch of the default settings.

Currently I found a work-around that is feasible but not 100% satisfying using Keyboard Maestro:

  1. On activation of DTP KM determines wether the main screen resolution is below or above 2000 in width.
  2. If resolution is above 2000 (external screen) it then checks wether the menu entry Two Pages is active and not checked > activates Two Pages layout.
  3. If resolution is below 2000 (internal screen) it then checks wether the menu entry Single Page is active and not checked > activates Single Page layout.

Naturally, this only works when a PDF is open in DEVONthink upon activation because only then the menu options for PDF layouts are active/available and my macro works as intended.

However, this is not always the case and I was wondering, if someone might have an idea how I could accomplish changing the default settings via apple script or terminal command or whatever I cannot think of at the moment.

If anyone is interested or having a similar issue, this is how my Keyboard Maestro macro looks like