Controlling position of Global or Group Palette

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