Copy link to clipboard
Copied
I was wondering if anyone knew of a way to paste a vector smart object from illustrator into photoshop without the dialog box coming up that has you accept the size/placement of the object.
I am able to do this using the code the scriptlistener plugin spits out but not without it. Unfortunately I'm running into a few problems with using the code the scriptlistener spits out so I was just wondering if anyone knew of a way to do it without that.
Thanks!
The only other way I can think of is to use...
app.activeDocument.paste();
Then call an external program to send an enter to Photoshop.
Copy link to clipboard
Copied
This is the best I could come up with...
pasteSO();
function pasteSO() {
var desc3 = new ActionDescriptor();
desc3.putBoolean( charIDToTypeID('AntA'), true );
desc3.putClass( charIDToTypeID('As '), stringIDToTypeID('smartObject') );
desc3.putEnumerated( charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), charIDToTypeID('Qcsa') );
var desc4 = new ActionDescriptor();
desc4.putUnitDouble( charIDToTypeID('Hrzn'), charIDToTypeID('#Pxl'), 0.000000 );
desc4.putUnitDouble( charIDToTypeID('Vrtc'), charIDToTypeID('#Pxl'), 0.000000 );
desc3.putObject( charIDToTypeID('Ofst'), charIDToTypeID('Ofst'), desc4 );
try{
executeAction( charIDToTypeID('past'), desc3, DialogModes.NO );
}catch(e){}
};
Copy link to clipboard
Copied
I'm actually currently doing something similar - that looks like what the scriptlistenr spits out (more or less). I think I'm just going to have to find a different work around.
Thanks for your help.
Copy link to clipboard
Copied
When you got the code from scriptlistener did you change the DialogModes from ALL to NO as Paul did? What about Paul's code doesn't work for you?
What type of vector are you pasting? From AI? Would placing as a smart object for the file instead of using the clipboard fit in your workflow?
Copy link to clipboard
Copied
Hi Michael -
As I stated above I can get the code to work how I need it to using the script listener code. What Paul wrote is basically exactly what I am currently doing. Both what I am doing and what Paul posted both work fine to paste an Illustrator Smart Object into Photoshop.
What I was asking was for a way to do it without using the ScriptListener code. It seems like none exists, which is fine, I was simply wondering if anyone else had found one as it would make my code less cumbersome.
Copy link to clipboard
Copied
Using the regular DOM you can choose to open a document in a smart object wrapper… but I guess you then have to duplicate to another document… A less cumbersome method than scriptlistener I think not…
Copy link to clipboard
Copied
zarprey wrote:
… Both what I am doing and what Paul posted both work fine to paste an Illustrator Smart Object into Photoshop.What I was asking was for a way to do it without using the ScriptListener code. It seems like none exists, which is fine, I was simply wondering if anyone else had found one as it would make my code less cumbersome.
What exactly do you really want to paste from where to where?
Copy link to clipboard
Copied
The only other way I can think of is to use...
app.activeDocument.paste();
Then call an external program to send an enter to Photoshop.
Copy link to clipboard
Copied
I think you're right. Probably not worth it in this case to spawn another program.
Thanks for your help.
Copy link to clipboard
Copied
Paul, I think PS behavior is use what ever vector paste option the user called last… Enter is just going to accept that whatever. So no guarantee of Smart Object. I don't see your function as cumbersome at all and would be the way I would do this… I know of nothing shorter nor sweeter…
Copy link to clipboard
Copied
Mark, I think because Paul's code has the line
desc3.putClass( charIDToTypeID('As '), stringIDToTypeID('smartObject') );
it will paste as a smart object regardless of the last user setting. At least it does for me.
Copy link to clipboard
Copied
Mike I agree, this was my point… DOM's app.activeDocument.paste(); will use the last user option if no dialogs are displayed during the script…? Paul's scriptlistener negates this and will always result in smart object… Thats why I think its the best and shortest option…