Standalone “Template Window” Action for Measuring & Copying Dimensions

In 5.207 alpha I have added a very basic version of this "Measure Area On Screen". It saves the result into these variables:

BTTActionMeasuredX, BTTActionMeasuredY, BTTActionMeasuredWidth, BTTActionMeasuredHeight

For writing them to the clipboard you'd currently need to run a little script "Run Real java Script"

//if you rename this, make sure to also rename it in the "function to call" field below.
async function copyDimensions() {
    let x = await get_number_variable("BTTActionMeasuredX");
    let y = await get_number_variable("BTTActionMeasuredY");
    let width = await get_number_variable("BTTActionMeasuredWidth"); 
    let height = await get_number_variable("BTTActionMeasuredHeight");

    // format in any way you want
    let clipboardString = `x: ${x}px, y: ${y}px, width: ${width}px, height: ${height}px`;

	await set_clipboard_content({content: clipboardString, format: 'NSPasteboardTypeString'})

		
    return clipboardString;
}

//edit: accidental minimum window size has been removed in 5.208 alpha

1 Like