Copy link to clipboard
Copied
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( "t
...
Copy link to clipboard
Copied
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 );
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Okay, I will look into it, thanks
Copy link to clipboard
Copied
I must have done something wrong. I copied the whole text into Notepad, saved it as .txt, changed the extension to .jsx (had to look up how to change extetnsions...) and installed in the correct folder. Then restarted Photoshop but now when I hit Ctrl-T on a layer it still defaults to center, not top left. .Do I need to do anything to make the script work? Do I have to hit 'execute script' somewhere instead of hitting Ctrl-T, maybe?
Copy link to clipboard
Copied
Edit: ignore previous reply, I now found File > Scrips (but I can't seem to delete or edit my own replies on here...)
Copy link to clipboard
Copied
Once installed in the program's Presets/Scripts folder as per the instructions in my previous link, you can assign a custom keyboard shortcut to the script.
Copy link to clipboard
Copied
Yes it works now, I also found out how to assign shortcuts, thanks.
Copy link to clipboard
Copied
Hello, i very like your solution, but if i want my reference point not reset it location every time i comfirm transform, how do i script it ? can it possible?
Copy link to clipboard
Copied
Doesn't look like the default can be changed. This can be set by script when you do a transform but must be set every time.
Copy link to clipboard
Copied
Omg, i know how to do it by using action feature actually, but it require me make a new action every time i change location of reference point. That make me wonder if some kind of script or addon can help me with that. But if script need to set every time then it cant help me. Thank you
Copy link to clipboard
Copied
Reference point is not a saved setting, its an input to transform. Just like -10 pixels would be an input.