Skip to main content
Known Participant
August 25, 2022
Open for Voting

Please make "transform path" vs "transform selection" a preference

  • August 25, 2022
  • 7 replies
  • 770 views

I often use paths in my drawings, but I rarely want to transform them using Command-T. I am regulary accidentally transforming a path that happens to be selected, instead of the selected area of my drawing. Then I need to de-select the path and try again – an interruption that becomes time-consuming when repeated many times a day.

 

A cleaner solution would be a preference in either the Paths palette or Transform bar that toggles between "transform ignores selected paths" and "transform affects selected paths."

 

This is probably my main irritant with PS interface these days (aside from far more crashes than back when this app was stabler). I'd appreciate it if you can give it some attention.

 

Thanks!

7 replies

Stephen Marsh
Community Expert
Community Expert
September 1, 2022

Glad it worked for you!

Known Participant
September 1, 2022

I was able to save as a .jsx. As you said, it was probably still a .txt. 

It took a few passes to get it to show up in the menu. Once it did, I applied the keyboard shortcut. It worked! Thanks a lot!

 

Cheers!

 

Gareth

Stephen Marsh
Community Expert
Community Expert
September 1, 2022

It's listed as a text doc, while the others are docs... Perhaps there is a double extension .txt.jsx or .jsx.txt that is hidden?

 

Ensure that it is a plain text doc, not a rich text doc.

 

The script would need to be installed if you were going to assign a custom keyboard shortcut.

Known Participant
September 1, 2022

That screen capture is from within the app – Browse – since it's not visible with the other scripts. No worries if you can't help. I have no experience working with PS scripts. I'll keep poking around. Thanks.

Stephen Marsh
Community Expert
Community Expert
September 1, 2022

Try installing then, I don't know why it is grayed out.

Known Participant
September 1, 2022

Thanks Stephen, I appreciate the tip. However, the script is grayed out when I try to "Browse" from File > Scripts. (I'm on macOS 12.5. I used TextEdit.)

 

Am I missing something?

Thanks!

 

 

Stephen Marsh
Community Expert
Community Expert
August 26, 2022

@GarethLind 

 

As a workaround, an Action or script can overcome this issue. All it needs to do is deselect the active path and transform.

 

My preference is a script, as you can replace the standard keyboard shortcut for transform with the script (Edit > Keyboard Shortcuts).

 

if (app.documents.length) {
    if (hasSelection() === true) {
        deselectPathThenTransform()
    } else {
        alert("There is no selection active to transform!")
    }
} else {
    alert('A document must be open to use this script!');
}


function deselectPathThenTransform() {
    try {
        // Deselect active path
        var iddeselect = stringIDToTypeID("deselect");
        var desc1512 = new ActionDescriptor();
        var idnull = stringIDToTypeID("null");
        var ref695 = new ActionReference();
        var idpath = stringIDToTypeID("path");
        var idordinal = stringIDToTypeID("ordinal");
        var idtargetEnum = stringIDToTypeID("targetEnum");
        ref695.putEnumerated(idpath, idordinal, idtargetEnum);
        desc1512.putReference(idnull, ref695);
        executeAction(iddeselect, desc1512, DialogModes.NO);
        // Interactive free transform
        var idselect = stringIDToTypeID("select");
        var desc1537 = new ActionDescriptor();
        var idnull = stringIDToTypeID("null");
        var ref713 = new ActionReference();
        var idmenuItemClass = stringIDToTypeID("menuItemClass");
        var idmenuItemType = stringIDToTypeID("menuItemType");
        var idfreeTransform = stringIDToTypeID("freeTransform");
        ref713.putEnumerated(idmenuItemClass, idmenuItemType, idfreeTransform);
        desc1537.putReference(idnull, ref713);
        executeAction(idselect, desc1537, DialogModes.ALL);
    } catch (error) {}
}

function hasSelection() {
    /* 
    check for selection - c.pfaffenbichler
    */
    var ref10 = new ActionReference();
    ref10.putProperty(stringIDToTypeID("property"), stringIDToTypeID("selection"));
    ref10.putEnumerated(charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
    var docDesc = executeActionGet(ref10);
    return docDesc.hasKey(stringIDToTypeID("selection"));
}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save the text file as .txt
  5. Rename the file extension from .txt to .jsx
  6. Install the .jsx file (see below):

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