I am new to photoshop scripting, and have come across a need to force an image to be 8"x10" at 300dpi (whether it is vertical or horizontal)
I need to maintain the correct orientation in the file, so an Action will not work, I believe I have to implement a script to accomplish this.
I have the below script so far, but I am not certain of how to input the variables / paramters
doc = app.activeDocument;
if (doc.height > doc.width) doc.resizeImage("2400 pixels","3600 pixels", "300", "BICUBIC");
if (doc.height > doc.width) doc.resizeCanvas("2400 pixels","3000 pixels", "MIDDLECENTER");
if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
if (doc.height < doc.width) doc.resizeCanvas(3000,2400,"MIDDLECENTER");
When I run this script, I get the following error:
Error 1245: Illegal argument - argument 4
- Enumerated value expected
Line: 5
if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
The fact that its failing on lien 5 lets nme know that I have the "If" portions of my script correct, I just dont know how to accomplish the functions correctly.
Any help would be appreciated!
Thanks,
Brian