• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Feature request: Auto Paste when creating Clipboard-sized file

1 Vote
Community Beginner ,
Jun 03, 2022 Jun 03, 2022

Copy link to clipboard

Copied

I do a lot of annotation of screen snips in Photoshop, so when creating a new file I often use the current Clipboard dimensions. It's not a big deal, but it would be cool if the current Clipboard contents would be automatically pasted into the new project when that New Document setting is used. That would save me from having to press Ctrl-V, thereby speeding up my workflow by a microsecond or two.  🙂

 

Could that be possible?

 

Thank you for considering it!

 

Rick Hohmann

[Personal information removed by moderator ]

Idea No status
TOPICS
Cross-app workflows , macOS , Windows

Views

103

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jun 03, 2022 Jun 03, 2022

@Z by HP Workstations 

 

Try this script:

 

/*
New Document from Clipboard Content.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/feature-request-auto-paste-when-creating-clipboard-sized-file/idc-p/12984246
v1.0 - 4th June 2022, Stephen Marsh
*/

#target photoshop

try {
    // New Doc from Clipboard - Courtesy of the late Michael L. Hale
    var desc = new ActionDescriptor();
    var desc1 = new ActionDescriptor();
    desc1.putString(stringIDToTypeID("preset"), "Clipboard");
    
...

Votes

Translate

Translate
5 Comments
Community Expert ,
Jun 03, 2022 Jun 03, 2022

Copy link to clipboard

Copied

@Z by HP Workstations 

 

I have upvoted, I think that this is a useful additional feature request/idea. I do many of my screenshot annotations in Apple Preview, which has this feature (my screenshots generally come from saved files, so I rarely use the New from Clipboard option).

 

One workaround, you can set up the Script Events Manager to use the paste command from an action or script whenever a new document is created. I'm not sure if it is possible so that this only happens when the clipboard document setup is used.

 

https://prepression.blogspot.com/2021/10/photoshop-script-events-manager.html

Votes

Translate

Translate

Report

Report
Community Expert ,
Jun 03, 2022 Jun 03, 2022

Copy link to clipboard

Copied

@Z by HP Workstations 

 

Try this script:

 

/*
New Document from Clipboard Content.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/feature-request-auto-paste-when-creating-clipboard-sized-file/idc-p/12984246
v1.0 - 4th June 2022, Stephen Marsh
*/

#target photoshop

try {
    // New Doc from Clipboard - Courtesy of the late Michael L. Hale
    var desc = new ActionDescriptor();
    var desc1 = new ActionDescriptor();
    desc1.putString(stringIDToTypeID("preset"), "Clipboard");
    desc.putObject(charIDToTypeID("Nw  "), charIDToTypeID("Dcmn"), desc1);
    executeAction(charIDToTypeID("Mk  "), desc, DialogModes.NO);
    // Paste the clipboard contents
    activeDocument.paste();
    // Flatten
    activeDocument.flatten();
    // Promote the Background to a standard layer
    // activeDocument.activeLayer.isBackgroundLayer = false;
} catch (error) {
    alert("The clipboard is empty or does not have suitable content to create a new document!");
}

 

 

  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 or browse to the .jsx file to run (see below)

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

 

Votes

Translate

Translate

Report

Report
Community Expert ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

@Z by HP Workstations – So how did the script work for you?

Votes

Translate

Translate

Report

Report
Community Beginner ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

Sorry Stephen! I didn't see your replies. I will try out the script today!

Votes

Translate

Translate

Report

Report
Community Beginner ,
Jun 08, 2022 Jun 08, 2022

Copy link to clipboard

Copied

LATEST

Hi again Stephen!

 

Yes, that script launched by the Events Manager works great! I added a confirm() call to ask if the automatic paste is desired and it does exactly what I need now.

 

Thank you (and Michael Hale) so much!

 

Here's what I have now:

/*
New Document from Clipboard Content.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/feature-request-auto-paste-when-creating-clipboard-sized-file/idc-p/12984246
v1.0 - 4th June 2022, Stephen Marsh
v1.0.1 - 8th June 2022, Rick Hohmann (added if-confirm to give the user the opportunity to skip the automatic paste)
*/

#target photoshop

if (confirm("Do you want to paste the Clipboard?")) {
    try {
        // New Doc from Clipboard - Courtesy of the late Michael L. Hale
        var desc = new ActionDescriptor();
        var desc1 = new ActionDescriptor();
        desc1.putString(stringIDToTypeID("preset"), "Clipboard");
        desc.putObject(charIDToTypeID("Nw  "), charIDToTypeID("Dcmn"), desc1);
        executeAction(charIDToTypeID("Mk  "), desc, DialogModes.NO);
        // Paste the clipboard contents
        activeDocument.paste();
        // Flatten
        activeDocument.flatten();
        // Promote the Background to a standard layer
        // activeDocument.activeLayer.isBackgroundLayer = false;
    } catch (error) {
        alert("The clipboard is empty or does not have suitable content to create a new document!");
    }
}

Votes

Translate

Translate

Report

Report