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

Place smart object into pre-existing Photoshop file

New Here ,
Apr 21, 2010 Apr 21, 2010

There's not a way to do this in Bridge, but maybe there is a way to script it?

I've never used a Bridge Script but would love to how to implement them, if I can get a script to do this...

I need to Import multiple files into an existing photoshop file (with a predetermined size ) as smart object layers in photoshop.

The options that Bridge currently offers falls short in 2 area

  • Load Files into Photoshop Layers-- does not import smart objects and creates a new photoshop file that ends up being as large as the largest imported file
  • Place into Photoshop--only lets you do one at a time

I need "Place into Photoshop" with multiple files

Is there a way to do this?

Thanks!!

TOPICS
Scripting
7.6K
Translate
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
Valorous Hero ,
Apr 24, 2010 Apr 24, 2010
Translate
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
New Here ,
Apr 24, 2010 Apr 24, 2010

I did see, thought how do I implement it?

Do I put it in the photoshop scripts folder? Does it have to be a certain kind of file?

Translate
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
Valorous Hero ,
Apr 24, 2010 Apr 24, 2010

Copy the script and paste into a new ExtendScript Toolkit window.

Start Bridge
Edit - Preferences -Startup Scripts
At the bottom click the "Reveal Button" this will open the folder where the script should be saved as a jsx file.

Restart Bridge so that it will pick-up the new script.

To Use:-
Select the thumbnails in Bridge you want to place into your Photoshop document.
From the Mouse Right click Menu select "Place Files In Photoshop".
Hope this helps.

Translate
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
New Here ,
Apr 24, 2010 Apr 24, 2010

hmmm, well the script loaded and I see the " Place files in Photoshop" option when I control/click, butthe files aren't loading?

After I hit control/click nothing happens....is it possibly a PC/MAC issue??? I noticed you said right click (which is PC). I'm on a Mac.

Translate
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
Valorous Hero ,
Apr 25, 2010 Apr 25, 2010

On the Mac you have to hold down the ctrl key and click the mouse to get the menu.

You will also need to have an open document in Photoshop else nothing will happen.

Translate
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
New Here ,
Apr 25, 2010 Apr 25, 2010

Yes, I did both those  things...still nothing. I'm on CS4, is this possibly for an older version?

The original post date of the script is oct 2009, so it seems that it would be CS4???

Translate
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
Valorous Hero ,
Apr 25, 2010 Apr 25, 2010

Please try this version, I've tested this in CS4...

#target bridge
if( BridgeTalk.appName == "bridge" ) {
  PlaceFiles = new MenuElement("command", "Place Files In Photoshop",
                               "at the end of Thumbnail");
  PlaceFiles.onSelect = function () {
    placeFilesInPhotoshop();
  };

  function placeFilesInPhotoshop(){
    var sels = app.document.selections;
    for (i = 0; i < sels.length; i++) {
  var t = new Thumbnail(sels);
      sendPicToPhotoshop(sels.path);
    }
  };
  function sendPicToPhotoshop(fileName) {
    function _placeFile(fileName) {
      if (!app.documents.length)  return;    
      var id35 = charIDToTypeID( 'Plc ' ) ;
      var desc8 = new ActionDescriptor();
      var id36 = charIDToTypeID( 'null' );
      desc8.putPath( id36, new File(fileName));
      var id37 = charIDToTypeID( 'FTcs' );
      var id38 = charIDToTypeID( 'QCSt' );
      var id39 = charIDToTypeID( 'Qcsa' );
      desc8.putEnumerated( id37, id38, id39 );
      var id40 = charIDToTypeID( 'Ofst' );
      var desc9 = new ActionDescriptor();
      var id41 = charIDToTypeID( 'Hrzn' );
      var id42 = charIDToTypeID( '#Pxl' );
      desc9.putUnitDouble( id41, id42, 0.000000 );
      var id43 = charIDToTypeID( 'Vrtc' );
      var id44 = charIDToTypeID( '#Pxl' );
      desc9.putUnitDouble( id43, id44, 0.000000 );
      var id45 = charIDToTypeID( 'Ofst' );
      desc8.putObject( id40, id45, desc9 );
      executeAction( id35, desc8, DialogModes.NO );
    };
    var bt = new BridgeTalk;
    bt.target = "photoshop";
    var myScript = ("var _ftn = " + _placeFile.toSource() + "; _ftn(" +
                    fileName.toSource() +");");
    bt.body = myScript;
    bt.send();
  };
};

Translate
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
New Here ,
Apr 25, 2010 Apr 25, 2010

hmmm, well it's still is not working. Thanks for your help though.

Translate
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
Valorous Hero ,
Apr 26, 2010 Apr 26, 2010

Ok how about pulling in Bridge selected documents from Photoshop.

This is a Photoshop script. Select your documents in Bridge then run this script from Photoshop.


#target Photoshop
main();
function main(){
if(!documents.length) return;
var fileList =[];
fileList =GetFilesFromBridge();
for(var a in fileList){
    placeFile(fileList);
    }
}

function GetFilesFromBridge() {
function script(){
var fL = app.document.selections;
var tF=[];
for(var a in fL){
    if(fL.type =='file'){
        tF.push(new File(encodeURI(fL
.spec.fsName)));
        }
    }
return tF.toSource();
}
var fileList;
  var bt = new BridgeTalk();
  bt.t...







function placeFile(filePath) {
    var desc18 = new ActionDescriptor();
    desc18.putPath( charIDToTypeID('null'), new File( filePath) );
    desc18.putEnumerated( charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), charIDToTypeID('Qcsa') );
        var desc19 = new ActionDescriptor();
        desc19.putUnitDouble( charIDToTypeID('Hrzn'), charIDToTypeID('#Pxl'), 0.000000 );
        desc19.putUnitDouble( charIDToTypeID('Vrtc'), charIDToTypeID('#Pxl'), 0.000000 );
    desc18.putObject( charIDToTypeID('Ofst'), charIDToTypeID('Ofst'), desc19 );
    executeAction( charIDToTypeID('Plc '), desc18, DialogModes.NO );
}

Translate
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
New Here ,
Apr 26, 2010 Apr 26, 2010

Ahhh!! SUCCESS!!

Thanks so much for your help Paul, it's very much appreciated!!

This is going to save me soooo much time!

Translate
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
Guest
May 19, 2010 May 19, 2010

Thanks for this - I am very grateful to you for providing it. Works Great!

Translate
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
New Here ,
Apr 08, 2011 Apr 08, 2011

Thanks for this Paul, just what I was looking for!

Translate
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
Guest
Jun 01, 2011 Jun 01, 2011
LATEST

Paul, your script works beautifully!  I've implemented and tested it in CS3.  Thanks so much!

Translate
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