Two Monitor Positioning Problem

I have two monitors My main monitor is the right one and is set as standard horizontal and the left one is rotated to vertical. I set up a macro to open nvALT for notes. I want to position it just so on my left monitor. I have a macro that does this - most of the time. But it seems inconsistent. Some of the time I get a quick little error window that it failed the two steps (window placing and window resizing) and the app opens on the right screen instead.

I have tried moving the steps to position the window in the macro, adding pauses but it is still inconsistent (flaky). Is there a way that I should have addressed the monitor window positioning that I missed? Is there a way to tell KM, start with this monitor and then apply window positioning?

I wanted this to work wether nvALT was already open but behind something or not open at all. I tried quitting if open and relaunching. I tried just launching the app. I have given as much as 6 seconds after launching for moving and resizing.

I have tried “move to -1200 and -500” but is there a way to start by identifying the monitor space it’s self? I want it to open and position absolute on the upper left of the left monitor and size to that monitors full width and about 500 px down.

Right now I can hit the hot key and run the macro and if it wont do it, quite and try again. Its inconsistent but eventually it will do it. And when it works, it works perfectly.

Thoughts? Thanks

Hey There,

Position the nvALT window exactly like you want it.

Run this from the Script Editor.app:

tell application "nvALT"
  bounds of front window
end tell

Change the bounds (defaultWindowBounds) in this script to reflect the ones you just acquired.

set defaultWindowBounds to {407, 23, 1312, 1196}
tell application "nvALT"
  if not running then run
  activate
  tell front window
    if bounds is not defaultWindowBounds then
      set bounds to defaultWindowBounds
    end if
  end tell
end tell

Run it in Keyboard Maestro from an Execute an AppleScript action.

If this doesn’t work more smoothly you may have something odd going on with your system.

-Chris

Brilliant! Works as it should. Thanks very much for that.