var script = "app.documents.add(" + artWidth + "," + artHeight + ");"
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!
mine was created in pixels, was yours 100 inches?
Yes, until I set the Rulers preference to pixels. It was set to inches, with the type set to pixels. Now, it works fine.
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…
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!
1 person found this helpful
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 + ");"
Sent from my iPhone
Works like a charm! Thanks!!