Controlling position of Global or Group Palette

Hi There!

I’m using the Global Palette and a Group Palette more and more…but one Thing bothers me:
I often switch working on the internal Screen (MacBookProRetina) and 2 external Screens at Home and 2 other external Screens at Work.

The Position of both Palettes (especially the Global One) moves around on the Screen after every “Switch” of Screens…and i have to move it so often where i want it to be…

Is there a way to control the Position of the Palettes with KeyboardMaestro?

Or does anyone have another idea how to solve this?

Thank you for your help :smile:

Thomas

Does anyone have an idea to solve this?

Thanks very much!

Thomas

You should be able to get started with a Yosemite version using something like this:

Reposition palette.kmmacros (20.9 KB)

osascript -l JavaScript <<JXA_END 2>/dev/null
(function (strPaletteName, X, Y) {
	strPaletteName = strPaletteName || 'Keyboard Maestro';
	if (strPaletteName === 'Global') strPaletteName =  'Keyboard Maestro';
	var appSE = Application('System Events'),
		lstProc = appSE.applicationProcesses.where({
			name: 'Keyboard Maestro Engine'
		}),
		procKMEngine = lstProc.length ? lstProc[0] : null,
		oWin = procKMEngine.windows.byName(strPaletteName),
		lstXY;

	try {
		lstXY = oWin.position();
		oWin.position = [X || lstXY[0], Y || lstXY[1]];
		return (strPaletteName === 'Keyboard Maestro' ?
			'Global' : strPaletteName) +
			' palette moved to '  +  oWin.position();
	} catch (e) {
		return 'Palette not found: ' + strPaletteName;
	}
})(
	"$KMVAR_Palette_name",
	"$KMVAR_New_X_position",
	"$KMVAR_New_Y_position"
)
JXA_END
3 Likes

As a custom action plugin for KM on Yosemite:

1 Like

Dear ComplexPoint,

Works perfectly for me!

Thank you so much - that’s so helpful!!!

Thomas

1 Like

Thanks for an awesome macro by @noisneil, Create and Populate a 'Show Palette of Macros' Macro, I'm growing quite fond of the Show Palette of Macros action.

To reposition these palettes, @ComplexPoint's JXA above works perfectly. (The Palette name needs to be set to Macros.)

My question is, how can this type of palette be hidden (or even closed) by a macro?

(This wiki page covers Groups Palettes and I've created macros to show and hide these palettes, but I've not found the corresponding controls for palettes created with the Show Palette of Macros action.)

Thanks in advance to anyone that can provide guidance.