Skip to main content
Participating Frequently
June 6, 2022
Answered

How to set Free Transform default reference point to top left?

  • June 6, 2022
  • 1 reply
  • 1608 views
Whenever I insert a picture as a new layer a, I want to position it by using the top left point as reference point (e.g. 100 pixels from top / left on X/Y axis). But whenever I hit Ctrl-T, the default reference point  is Center. What can I do to make the default Top Left instead of Center? 
This topic has been closed for replies.
Correct answer Stephen Marsh

You can record an action with the modal control on (see screenshot) for an interactive transform and use an F-Key action shortcut. 

 

 

A script can also do the same with the choice of a custom keyboard shortcut.

 

transformLayer(0, 0);

function transformLayer(horizontal, vertical) {
	var s2t = function (s) {
		return app.stringIDToTypeID(s);
	};
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
	descriptor.putReference( s2t( "null" ), reference );
	descriptor.putEnumerated( s2t( "freeTransformCenterState" ), s2t( "quadCenterState" ), s2t( "QCSCorner0" )); // upper left
	descriptor.putUnitDouble( s2t( "horizontal" ), s2t( "pixelsUnit" ), horizontal );
	descriptor.putUnitDouble( s2t( "vertical" ), s2t( "pixelsUnit" ), vertical );
	descriptor.putObject( s2t( "offset" ), s2t( "offset" ), descriptor );
	descriptor.putEnumerated( s2t( "interfaceIconFrameDimmed" ), s2t( "interpolationType" ), s2t( "bicubicSmoother" ));
	executeAction( s2t( "transform" ), descriptor, DialogModes.ALL );
}

 

1 reply

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
June 6, 2022

You can record an action with the modal control on (see screenshot) for an interactive transform and use an F-Key action shortcut. 

 

 

A script can also do the same with the choice of a custom keyboard shortcut.

 

transformLayer(0, 0);

function transformLayer(horizontal, vertical) {
	var s2t = function (s) {
		return app.stringIDToTypeID(s);
	};
	var descriptor = new ActionDescriptor();
	var reference = new ActionReference();
	reference.putEnumerated( s2t( "layer" ), s2t( "ordinal" ), s2t( "targetEnum" ));
	descriptor.putReference( s2t( "null" ), reference );
	descriptor.putEnumerated( s2t( "freeTransformCenterState" ), s2t( "quadCenterState" ), s2t( "QCSCorner0" )); // upper left
	descriptor.putUnitDouble( s2t( "horizontal" ), s2t( "pixelsUnit" ), horizontal );
	descriptor.putUnitDouble( s2t( "vertical" ), s2t( "pixelsUnit" ), vertical );
	descriptor.putObject( s2t( "offset" ), s2t( "offset" ), descriptor );
	descriptor.putEnumerated( s2t( "interfaceIconFrameDimmed" ), s2t( "interpolationType" ), s2t( "bicubicSmoother" ));
	executeAction( s2t( "transform" ), descriptor, DialogModes.ALL );
}

 

Participating Frequently
June 6, 2022

This looks complicated with all the machine language... but I do not want an action that always sets a layer at a specific point, I just want the Ctrl-T options to use top-left by default instead of center.

Stephen Marsh
Community Expert
Community Expert
June 6, 2022

Well, that is what the interactive modal control action or script do. Have you actually tried them? Just record the transform with no X/Y change (0 - a zero value) and no change in % width/height (a 100% value). I am not aware of any other way to "default" the transform anchor point.

 

 

More on saving/installing JavaScript code here, it is not as complex as you may think:

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html