🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.photoshop.scripting
Article #599

Paste from clipboard?

#599
From: ZeroskillZ
Date: Tue, 20 Jan 2009 18:09
70 lines
4524 bytes
I used the listener to get the javascript to copy in an object from InDesign using BridgeTalk. the problem is, I want to use the dimensions from the clipboard every time, not the dimensions recorded during the original "listen", anybody know how to change this?

Thanks in advance!

Heres the current script:

var obj = app.activeDocument.selection;
app.select(obj);
app.copy(obj);
//function pasteToPS() {
var bt = new BridgeTalk;
bt.target = "photoshop";

var myScript = '//start\n';
// insert stuff from PS listener below this line
// =======================================================
  myScript += 'var id53 = charIDToTypeID( "Mk " );\n';
  myScript += ' var desc8 = new ActionDescriptor();\n';
      myScript += 'var id54 = charIDToTypeID( "Nw " );\n';
          myScript += 'var desc9 = new ActionDescriptor();\n';
          myScript += 'var id55 = charIDToTypeID( "Md " );\n';
          myScript += 'var id56 = charIDToTypeID( "RGBM" );\n';
          myScript += 'desc9.putClass( id55, id56 );\n';
          myScript += 'var id57 = charIDToTypeID( "Wdth" );\n';
          myScript += 'var id58 = charIDToTypeID( "#Rlt" );\n';
//var from clipboard instead of the 122 value?
         myScript += 'desc9.putUnitDouble( id57, id58, 122.000000 );\n';
          myScript += 'var id59 = charIDToTypeID( "Hght" );\n';
          myScript += 'var id60 = charIDToTypeID( "#Rlt" );\n';
//var from clipboard instead ofthe 119 value?
		 myScript += 'desc9.putUnitDouble( id59, id60, 122.000000 );\n';
          myScript += 'var id61 = charIDToTypeID( "Rslt" );\n';
          myScript += 'var id62 = charIDToTypeID( "#Rsl" );\n';
          myScript += 'desc9.putUnitDouble( id61, id62, 72.000000 );\n';
          myScript += 'var id63 = stringIDToTypeID( "pixelScaleFactor" );\n';
          myScript += 'desc9.putDouble( id63, 1.000000 );\n';
          myScript += 'var id64 = charIDToTypeID( "Fl " );\n';
          myScript += 'var id65 = charIDToTypeID( "Fl " );\n';
          myScript += 'var id66 = charIDToTypeID( "Trns" );\n';
          myScript += 'desc9.putEnumerated( id64, id65, id66 );\n';
          myScript += 'var id67 = charIDToTypeID( "Dpth" );\n';
          myScript += 'desc9.putInteger( id67, 8 );\n';
          myScript += 'var id68 = stringIDToTypeID( "profile" );\n';
          myScript += 'desc9.putString( id68, "sRGB IEC61966-2.1" );\n';
      myScript += 'var id69 = charIDToTypeID( "Dcmn" );\n';
      myScript += 'desc8.putObject( id54, id69, desc9 );\n';
  myScript += 'executeAction( id53, desc8, DialogModes.NO );\n';

// =======================================================
  myScript += 'var id70 = charIDToTypeID( "past" );\n';
      myScript += 'var desc10 = new ActionDescriptor();\n';
      myScript += 'var id71 = charIDToTypeID( "AntA" );\n';
      myScript += 'desc10.putBoolean( id71, true );\n';
      myScript += 'var id72 = charIDToTypeID( "As " );\n';
      myScript += 'var id73 = stringIDToTypeID( "smartObject" );\n';
      myScript += 'desc10.putClass( id72, id73 );\n';
      myScript += 'var id74 = charIDToTypeID( "FTcs" );\n';
      myScript += 'var id75 = charIDToTypeID( "QCSt" );\n';
      myScript += 'var id76 = charIDToTypeID( "Qcsa" );\n';
      myScript += 'desc10.putEnumerated( id74, id75, id76 );\n';
      myScript += 'var id77 = charIDToTypeID( "Ofst" );\n';
          myScript += 'var desc11 = new ActionDescriptor();\n';
          myScript += 'var id78 = charIDToTypeID( "Hrzn" );\n';
          myScript += 'var id79 = charIDToTypeID( "#Rlt" );\n';
          myScript += 'desc11.putUnitDouble( id78, id79, 0.000000 );\n';
          myScript += 'var id80 = charIDToTypeID( "Vrtc" );\n';
          myScript += 'var id81 = charIDToTypeID( "#Rlt" );\n';
          myScript += 'desc11.putUnitDouble( id80, id81, 0.000000 );\n';
      myScript += 'var id82 = charIDToTypeID( "Ofst" );\n';
      myScript += 'desc10.putObject( id77, id82, desc11 );\n';
Technical Details
Message-ID: <59b7909a.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,7c7b002b4943eb87,start
X-Google-Attributes: gidf5839,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: ZeroskillZ@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.photoshop.scripting
Subject: Paste from clipboard?
Message-ID: <59b7909a.-1@webcrossing.la2eafNXanI>
Date: Tue, 20 Jan 2009 10:09:52 -0800
Lines: 80
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit