Adding Canvas Dimesnions to file name in export script

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

Clash

Adding Canvas Dimesnions to file name in export script

Post by Clash »

I'm working on an export script and I'm having trouble defining the canvas dimensions as a variable.

Help?

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Adding Canvas Dimesnions to file name in export script

Post by Mike Hale »

It might help to read/review the scripting guides. For example in the javascript guide under document properties you will find the following that will give you the doc dimensions.

app.activeDocument.width
app.activeDocument.height
Clash

Adding Canvas Dimesnions to file name in export script

Post by Clash »

I have Code: Select allvar docDim = app.activeDocument.width + "x" + app.activeDocument.height; in place.

However, the output is 800 px x 600 px.

How do I leave out the px? (800x600)
Mike Hale

Adding Canvas Dimesnions to file name in export script

Post by Mike Hale »

Code: Select allapp.activeDocument.width.as('px') + "x" + app.activeDocument.height.as('px');