Copy link to clipboard
Copied
Hello,
I'm simply trying to send send 2 variables through BT to PS from IA to create a new document of the specified size. Why isn't this working, please? It works fine if I substitute numbers for the variables in the body of the script.
#target illustrator;
var artWidth = 100;
var artHeight = 100;
var bt = new BridgeTalk;
bt.target = "photoshop";
var script = "app.documents.add(artWidth,artHeight);"
bt.body = script;
bt.send();
Thank you for saving my sanity, again!
try
var script = "app.documents.add(" + artWidth + "," + artHeight + ");"
Copy link to clipboard
Copied
try
var script = "app.documents.add(" + artWidth + "," + artHeight + ");"
Copy link to clipboard
Copied
Works great! Now, how do I tell Photoshop to make the document in pixels instead of inches? What I'm trying to do is take the dimension of a selection in Illustrator and have Photoshop make the exact same size document, to which the art from Illustrator will be placed.
Thanks again for your help Carlos, I appreciate it!
Copy link to clipboard
Copied
mine was created in pixels, was yours 100 inches?
Copy link to clipboard
Copied
Yes, until I set the Rulers preference to pixels. It was set to inches, with the type set to pixels. Now, it works fine.
Copy link to clipboard
Copied
Then you need to include this as part of the photoshop script syntax… You may be able to record Action Manager syntax to create a new document using clipboard bounds…
Copy link to clipboard
Copied
Thanks Mark,
When I initially started on this, I knew that PS gave you the option of using the clipboard for the new document size but, I didn't see anything in the PS Ref about being able to script that option during a document creation. That's what gave me the idea of pulling the dimensions of the art from illustrator and sending them to PS.
I know zero about scripting PS and I guess I assumed the scripts would automatically work in pixels like AI. Since I've only really scripted Illustrator (Applescript and now JS), I was suprised at just how much the scripting options differered.
Luckily, I only have to take art from Illustrator into PS and save it as a TIFF (with the options that PS offers over AI).
You mentioned something that I didn't know you could do, though. Before getting into scripting, I used to record actions for things that they could do. But, how do you get to the actual code they produce? Can you use that in scripts? If so, could you transfer that code into ScriptUI code for use in a palette? Seems like that would open up alot of options!
Thanks!
Copy link to clipboard
Copied
ha!
I know close to nothing about photoshop...but looking at the OMV, I came up with this
var script = "app.preferences.rulerUnits = Units.PIXELS; app.documents.add(" + artWidth + "," + artHeight + ");"
Copy link to clipboard
Copied
Works!???
Sent from my iPhone
Copy link to clipboard
Copied
Works like a charm! Thanks!!